org.springframework.data.auditing

## Class AuditingHandlerSupport

- java.lang.Object
- - org.springframework.data.auditing.AuditingHandlerSupport

Direct Known Subclasses:
  AuditingHandler, ReactiveAuditingHandler

    public abstract class AuditingHandlerSupport
    extends Object

Support class to implement auditing handlers.

Since:
  2.4
Author:
  Oliver Gierke, Christoph Strobl, Mark Paluch

### Constructor Summary

Constructors
Constructor and Description
`AuditingHandlerSupport(PersistentEntities entities)` Creates a new `AuditableBeanWrapper` using the given `PersistentEntities` when looking up auditing metadata via reflection.

### Method Summary

All Methods Instance Methods Concrete Methods
`protected boolean` `isAuditable(Object source)` Returns whether the given source is considered to be auditable in the first place.
`void` `setDateTimeForNow(boolean dateTimeForNow)` Setter do determine if `Auditable.setCreatedDate(TemporalAccessor)`} and `Auditable.setLastModifiedDate(TemporalAccessor)` shall be filled with the current Java time.
`void` `setDateTimeProvider(DateTimeProvider dateTimeProvider)` Sets the `DateTimeProvider` to be used to determine the dates to be set.
`void` `setModifyOnCreation(boolean modifyOnCreation)` Set this to true if you want to treat entity creation as modification and thus setting the current date as modification date during creation, too.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### AuditingHandlerSupport

    public AuditingHandlerSupport(PersistentEntities entities)

Creates a new `AuditableBeanWrapper` using the given `PersistentEntities` when looking up auditing metadata via reflection.

Parameters:
  `entities` - must not be null.

### Method Detail

#### setDateTimeForNow

    public void setDateTimeForNow(boolean dateTimeForNow)

Setter do determine if `Auditable.setCreatedDate(TemporalAccessor)`} and `Auditable.setLastModifiedDate(TemporalAccessor)` shall be filled with the current Java time. Defaults to `true`. One might set this to `false` to use database features to set entity time.

Parameters:
  `dateTimeForNow` - the dateTimeForNow to set

#### setModifyOnCreation

    public void setModifyOnCreation(boolean modifyOnCreation)

Set this to true if you want to treat entity creation as modification and thus setting the current date as modification date during creation, too. Defaults to `true`.

Parameters:
  `modifyOnCreation` - if modification information shall be set on creation, too

#### setDateTimeProvider

    public void setDateTimeProvider(@Nullable
                                    DateTimeProvider dateTimeProvider)

Sets the `DateTimeProvider` to be used to determine the dates to be set.

Parameters:
  `dateTimeProvider` - can be null, defaults to `CurrentDateTimeProvider` in that case.

#### isAuditable

    protected final boolean isAuditable(Object source)

Returns whether the given source is considered to be auditable in the first place.

Parameters:
  `source` - must not be null.
Returns:
  true if the given source considered to be auditable.