public class ReflectionServiceImpl extends java.lang.Object implements ReflectionService
Modifier and Type | Field and Description |
---|---|
static java.util.Set<java.lang.String> |
primitiveTypeNames |
Constructor and Description |
---|
ReflectionServiceImpl() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
convertStringToSimpleType(java.lang.String value,
java.lang.Class<?> type) |
java.util.Collection<?> |
createCollection(java.lang.Class<?> type) |
java.util.Set<java.lang.reflect.Field> |
getAllFields(java.lang.Class<?> clazz) |
<A extends java.lang.annotation.Annotation> |
getAnnotationRecursive(java.lang.Class<A> annotationClass,
java.lang.Class<?> type) |
java.lang.Class<?> |
getClassForName(java.lang.String typeName)
Handles primitive types.
|
java.lang.Object |
getEnumByString(java.lang.Class<?> enumType,
java.lang.String name) |
java.lang.reflect.Field |
getFieldByAnnotation(java.lang.Class<?> type,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation) |
java.lang.reflect.Field |
getFieldByAnnotation(java.lang.Object object,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation) |
java.lang.reflect.Field |
getFieldByName(java.lang.Class<?> type,
java.lang.String fieldName) |
java.lang.reflect.Field |
getFieldByName(java.lang.Object object,
java.lang.String fieldName) |
java.util.List<java.lang.reflect.Field> |
getFieldsByAnnotation(java.lang.Class<?> type,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation) |
java.lang.Object |
getFieldValueNoSecurity(java.lang.reflect.Field f,
java.lang.Object o) |
java.lang.Class<?> |
getGenericType(java.lang.Class<?> clazz) |
java.lang.Class<?> |
getGenericType(java.lang.reflect.Field exportableField) |
java.lang.Class<?> |
getGenericType(java.lang.reflect.ParameterizedType type) |
java.lang.reflect.Method |
getMethod(java.lang.Class<?> clazz,
java.lang.String name,
java.lang.Class<?>... args) |
java.lang.reflect.Method |
getMethodByAnnotation(java.lang.Class<?> type,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation) |
java.lang.reflect.Method |
getMethodByAnnotation(java.lang.Object object,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation) |
boolean |
isAbstract(java.lang.reflect.Method method) |
boolean |
isCollection(java.lang.Class<?> type) |
boolean |
isCollection(java.lang.reflect.Field exportableField) |
boolean |
isList(java.lang.Class<?> type) |
boolean |
isPrimitiveTypeName(java.lang.String typeName) |
boolean |
isSet(java.lang.Class<?> type) |
boolean |
isSimpleField(java.lang.reflect.Field exportableField) |
boolean |
isSimpleType(java.lang.Class<?> type) |
boolean |
representsNull(java.lang.Class<?> type) |
public boolean isSimpleField(java.lang.reflect.Field exportableField)
isSimpleField
in interface ReflectionService
public boolean isSimpleType(java.lang.Class<?> type)
isSimpleType
in interface ReflectionService
public boolean isCollection(java.lang.reflect.Field exportableField)
isCollection
in interface ReflectionService
public boolean isCollection(java.lang.Class<?> type)
isCollection
in interface ReflectionService
public boolean isList(java.lang.Class<?> type)
isList
in interface ReflectionService
public boolean isSet(java.lang.Class<?> type)
isSet
in interface ReflectionService
public java.lang.Class<?> getGenericType(java.lang.reflect.Field exportableField)
getGenericType
in interface ReflectionService
public java.lang.Class<?> getGenericType(java.lang.Class<?> clazz)
getGenericType
in interface ReflectionService
public java.lang.Class<?> getGenericType(java.lang.reflect.ParameterizedType type)
getGenericType
in interface ReflectionService
public java.lang.Class<?> getClassForName(java.lang.String typeName) throws java.lang.ClassNotFoundException
ReflectionService
getClassForName
in interface ReflectionService
java.lang.ClassNotFoundException
public boolean isPrimitiveTypeName(java.lang.String typeName)
isPrimitiveTypeName
in interface ReflectionService
public java.lang.Object convertStringToSimpleType(java.lang.String value, java.lang.Class<?> type)
convertStringToSimpleType
in interface ReflectionService
public java.util.Collection<?> createCollection(java.lang.Class<?> type)
createCollection
in interface ReflectionService
public java.lang.Object getEnumByString(java.lang.Class<?> enumType, java.lang.String name)
getEnumByString
in interface ReflectionService
public java.lang.reflect.Field getFieldByAnnotation(java.lang.Object object, java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
getFieldByAnnotation
in interface ReflectionService
public java.lang.reflect.Field getFieldByAnnotation(java.lang.Class<?> type, java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
getFieldByAnnotation
in interface ReflectionService
public java.lang.reflect.Method getMethodByAnnotation(java.lang.Object object, java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
getMethodByAnnotation
in interface ReflectionService
public java.lang.reflect.Method getMethodByAnnotation(java.lang.Class<?> type, java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
getMethodByAnnotation
in interface ReflectionService
public java.util.Set<java.lang.reflect.Field> getAllFields(java.lang.Class<?> clazz)
getAllFields
in interface ReflectionService
public java.util.List<java.lang.reflect.Field> getFieldsByAnnotation(java.lang.Class<?> type, java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
getFieldsByAnnotation
in interface ReflectionService
public java.lang.reflect.Field getFieldByName(java.lang.Object object, java.lang.String fieldName)
getFieldByName
in interface ReflectionService
public java.lang.reflect.Field getFieldByName(java.lang.Class<?> type, java.lang.String fieldName)
getFieldByName
in interface ReflectionService
public boolean representsNull(java.lang.Class<?> type)
representsNull
in interface ReflectionService
public java.lang.Object getFieldValueNoSecurity(java.lang.reflect.Field f, java.lang.Object o)
getFieldValueNoSecurity
in interface ReflectionService
public <A extends java.lang.annotation.Annotation> A getAnnotationRecursive(java.lang.Class<A> annotationClass, java.lang.Class<?> type)
getAnnotationRecursive
in interface ReflectionService
public java.lang.reflect.Method getMethod(java.lang.Class<?> clazz, java.lang.String name, java.lang.Class<?>... args)
getMethod
in interface ReflectionService
public boolean isAbstract(java.lang.reflect.Method method)
isAbstract
in interface ReflectionService