Class ReflectionTools
java.lang.Object
org.hibernate.envers.internal.tools.ReflectionTools
- Author:
- Adam Warski (adam at warski dot org), Lukasz Antoniak (lukasz dot antoniak at gmail dot com), Chris Cranford
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FieldgetField(Class cls, PropertyData propertyData) static GettergetGetter(Class cls, String propertyName, String accessorType, ServiceRegistry serviceRegistry) static GettergetGetter(Class cls, PropertyData propertyData, ServiceRegistry serviceRegistry) static XPropertygetProperty(XClass clazz, String propertyName) static XPropertygetProperty(XClass clazz, String propertyName, String accessType) static SettergetSetter(Class cls, String propertyName, String accessorType, ServiceRegistry serviceRegistry) static SettergetSetter(Class cls, PropertyData propertyData, ServiceRegistry serviceRegistry) static Class<?>getType(Class cls, PropertyData propertyData, ServiceRegistry serviceRegistry) static <T> Class<T>loadClass(String name, ClassLoaderService classLoaderService) Locate class with a given name.
-
Constructor Details
-
ReflectionTools
public ReflectionTools()
-
-
Method Details
-
getGetter
public static Getter getGetter(Class cls, PropertyData propertyData, ServiceRegistry serviceRegistry) -
getGetter
public static Getter getGetter(Class cls, String propertyName, String accessorType, ServiceRegistry serviceRegistry) -
getSetter
public static Setter getSetter(Class cls, PropertyData propertyData, ServiceRegistry serviceRegistry) -
getSetter
public static Setter getSetter(Class cls, String propertyName, String accessorType, ServiceRegistry serviceRegistry) -
getField
-
getType
public static Class<?> getType(Class cls, PropertyData propertyData, ServiceRegistry serviceRegistry) -
getProperty
- Parameters:
clazz- Source class.propertyName- Property name.- Returns:
- Property object or
nullif none with expected name has been found.
-
getProperty
- Parameters:
clazz- Source class.propertyName- Property name.accessType- Expected access type. Legal values are field and property.- Returns:
- Property object or
nullif none with expected name and access type has been found.
-
loadClass
public static <T> Class<T> loadClass(String name, ClassLoaderService classLoaderService) throws ClassLoadingException Locate class with a given name.- Parameters:
name- Fully qualified class name.classLoaderService- Class loading service. Passingnullis "allowed", but will result in TCCL usage.- Returns:
- The cass reference.
- Throws:
ClassLoadingException- Indicates the class could not be found.
-