Class ReflectionEntityInstantiator

java.lang.Object
org.neo4j.ogm.metadata.reflect.ReflectionEntityInstantiator
All Implemented Interfaces:
EntityInstantiator

public class ReflectionEntityInstantiator extends Object implements EntityInstantiator
Simple instantiator that uses either the no-arg constructor, without using property values, or creates an instance with property population.
  • Constructor Details

    • ReflectionEntityInstantiator

      public ReflectionEntityInstantiator(MetaData metadata)
  • Method Details

    • createInstance

      public <T> T createInstance(Class<T> clazz, Map<String,Object> propertyValues)
      Creates an instance of a given class. Ignores the provided propertyValues for compatibility reasons.
      Specified by:
      createInstance in interface EntityInstantiator
      Type Parameters:
      T - Type to create
      Parameters:
      clazz - The class to materialize.
      propertyValues - Properties of the object (unused!)
      Returns:
      The created instance.
    • createInstanceWithConstructorArgs

      public <T> T createInstanceWithConstructorArgs(Class<T> clazz, Map<String,Object> propertyValues)
      Description copied from interface: EntityInstantiator
      Creates an instance of a given class and populates the constructor fields, if needed/possible.
      Specified by:
      createInstanceWithConstructorArgs in interface EntityInstantiator
      Type Parameters:
      T - Type to create
      Parameters:
      clazz - The class to maerialize.
      propertyValues - Properties of the object (needed for constructors with args)
      Returns:
      New instance.