Class AbstractMapper

java.lang.Object
org.hibernate.envers.internal.entities.mapper.AbstractMapper
Direct Known Subclasses:
AbstractIdMapper, AbstractMiddleComponentMapper, AbstractPropertyMapper

public abstract class AbstractMapper extends Object
A base class for all entity mapper implementations.
  • 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 null
      object - the object for which the value should be read, should not be null
      serviceRegistry - 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 null
      accessType - the property access type, should not be null
      object - the object for which the value should be read, should not be null
      serviceRegistry - 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 null
      object - the object for which the value should be set, should not be null
      value - the value ot be set, may be null
      serviceRegistry - 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 null
      source - the source object, should not be null
      destination - the destination object, should not be null
      serviceRegistry - the service registry, should not be null
    • newObjectInstance

      protected <T> T newObjectInstance(Class<T> clazz, Object... args)
      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 null
      args - the variadic constructor arguments, may be omitted.
      Returns:
      a new instance of the class