public class JavaClassAccessor extends Object implements ClassAccessor
ClassAccessor
targeting Java classes. Use GroovyClassAccessor
for Groovy classes instead.Modifier and Type | Field and Description |
---|---|
protected static com.google.common.cache.Cache<Class,JavaClassAccessor> |
classAccessorCache |
static String |
copyright |
protected Class |
javaClass |
protected PropertyAccessor[] |
keyPropertyAccessors |
static org.slf4j.Logger |
logger |
static String[] |
PROPERTY_NAME_BLACKLIST |
protected PropertyAccessor[] |
propertyAccessors |
Modifier | Constructor and Description |
---|---|
protected |
JavaClassAccessor(Class javaClass) |
Modifier and Type | Method and Description |
---|---|
<T extends Annotation> |
getAnnotation(Class<T> annotationClass) |
Annotation[] |
getAnnotations() |
static JavaClassAccessor |
getClassAccessor(Class javaClass) |
Annotation[] |
getDeclaredAnnotations() |
Class |
getJavaClass() |
PropertyAccessor[] |
getKeyProperties() |
String |
getName() |
PropertyAccessor[] |
getProperties() |
PropertyAccessor |
getProperty(String propertyName) |
Class<?> |
getType()
The type of the objects this accessor can operate on.
|
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationClass) |
protected boolean |
isValidProperty(PropertyAccessor propertyAccessor) |
Object |
newInstance() |
protected List<PropertyAccessor> |
setupKeyPropertyAccessors() |
protected List<PropertyAccessor> |
setupPropertyAccessors() |
String |
toString() |
public static final String copyright
public static final String[] PROPERTY_NAME_BLACKLIST
protected final Class javaClass
protected final PropertyAccessor[] propertyAccessors
protected final PropertyAccessor[] keyPropertyAccessors
protected static final com.google.common.cache.Cache<Class,JavaClassAccessor> classAccessorCache
public static final org.slf4j.Logger logger
protected JavaClassAccessor(Class javaClass)
public static JavaClassAccessor getClassAccessor(Class javaClass)
protected List<PropertyAccessor> setupPropertyAccessors()
protected boolean isValidProperty(PropertyAccessor propertyAccessor)
protected List<PropertyAccessor> setupKeyPropertyAccessors()
public String getName()
getName
in interface ClassAccessor
public Class<?> getType()
ClassAccessor
getType
in interface ClassAccessor
public PropertyAccessor getProperty(String propertyName) throws NoSuchFieldException
getProperty
in interface ClassAccessor
NoSuchFieldException
public PropertyAccessor[] getProperties()
getProperties
in interface ClassAccessor
public PropertyAccessor[] getKeyProperties()
getKeyProperties
in interface ClassAccessor
public Object newInstance()
newInstance
in interface ClassAccessor
public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
isAnnotationPresent
in interface AnnotatedElement
public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
getAnnotation
in interface AnnotatedElement
public Annotation[] getAnnotations()
getAnnotations
in interface AnnotatedElement
public Annotation[] getDeclaredAnnotations()
getDeclaredAnnotations
in interface AnnotatedElement
public Class getJavaClass()