Class AbstractMapper
java.lang.Object
org.hibernate.envers.internal.entities.mapper.AbstractMapper
- Direct Known Subclasses:
AbstractIdMapper,AbstractMiddleComponentMapper,AbstractPropertyMapper
A base class for all entity mapper implementations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidgetAndSetValue(PropertyData propertyData, Object source, Object destination, ServiceRegistry serviceRegistry) Gets the value from the source object and sets the value in the destination object.protected <T> TgetValueFromObject(String propertyName, String accessType, Object object, ServiceRegistry serviceRegistry) Get a value from the specified object.protected <T> TgetValueFromObject(PropertyData propertyData, Object object, ServiceRegistry serviceRegistry) Get a value from the specified object.protected <T> TnewObjectInstance(Class<T> clazz, Object... args) Creates a new object based on the specified class with the given constructor arguments.protected voidsetValueOnObject(PropertyData propertyData, Object object, Object value, ServiceRegistry serviceRegistry) Set the specified value on the object.
-
Constructor Details
-
AbstractMapper
public AbstractMapper()
-
-
Method Details
-
getValueFromObject
protected <T> T getValueFromObject(PropertyData propertyData, Object object, ServiceRegistry serviceRegistry) Get a value from the specified object.- Type Parameters:
T- the return type- Parameters:
propertyData- the property data, should not be nullobject- the object for which the value should be read, should not be nullserviceRegistry- the service registry, should not be null- Returns:
- the value read from the object, may be null
-
getValueFromObject
protected <T> T getValueFromObject(String propertyName, String accessType, Object object, ServiceRegistry serviceRegistry) Get a value from the specified object.- Type Parameters:
T- the return type- Parameters:
propertyName- the property name, should not be nullaccessType- the property access type, should not be nullobject- the object for which the value should be read, should not be nullserviceRegistry- the service registry, should not be null- Returns:
- the value read from the object, may be null
-
setValueOnObject
protected void setValueOnObject(PropertyData propertyData, Object object, Object value, ServiceRegistry serviceRegistry) Set the specified value on the object.- Parameters:
propertyData- the property data, should not be nullobject- the object for which the value should be set, should not be nullvalue- the value ot be set, may be nullserviceRegistry- the service registry, should not be null
-
getAndSetValue
protected void getAndSetValue(PropertyData propertyData, Object source, Object destination, ServiceRegistry serviceRegistry) Gets the value from the source object and sets the value in the destination object.- Parameters:
propertyData- the property data, should not be nullsource- the source object, should not be nulldestination- the destination object, should not be nullserviceRegistry- the service registry, should not be null
-
newObjectInstance
Creates a new object based on the specified class with the given constructor arguments.- Type Parameters:
T- the return class type- Parameters:
clazz- the class, must not be nullargs- the variadic constructor arguments, may be omitted.- Returns:
- a new instance of the class
-