public class Reflection extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Reflection.AnnotatedPropertyKey |
protected static class |
Reflection.NameTypePropertyKey |
protected static interface |
Reflection.SinglePropertyKey |
| Modifier and Type | Field and Description |
|---|---|
protected ClassLoader |
classLoader |
protected BypassConstructorAllocator |
instanceFactory |
protected Comparator<Property> |
lexicalPropertyComparator |
protected static Property |
NULL_PROPERTY |
protected ConcurrentMap<Class<?>,List<Property>> |
serializablePropertiesCache |
protected ConcurrentMap<Reflection.SinglePropertyKey,Property> |
singlePropertyCache |
protected static int |
STATIC_PRIVATE_PROTECTED_MASK |
protected static int |
STATIC_TRANSIENT_MASK |
| Constructor and Description |
|---|
Reflection(ClassLoader classLoader) |
Reflection(ClassLoader classLoader,
BypassConstructorAllocator instanceFactory) |
| Modifier and Type | Method and Description |
|---|---|
Property |
findProperty(Class<?> cls,
Class<? extends Annotation> annotationClass) |
Property |
findProperty(Class<?> cls,
String name,
Class<?> type) |
protected List<Property> |
findSerializableDeclaredProperties(Class<?> cls) |
List<Property> |
findSerializableProperties(Class<?> cls) |
Property |
findSerializableProperty(Class<?> cls,
String name) |
ClassLoader |
getClassLoader() |
boolean |
isRegularClass(Class<?> cls) |
Class<?> |
loadClass(String className) |
protected FieldProperty |
newFieldProperty(Field field) |
<T> T |
newInstance(Class<T> cls) |
<T> T |
newInstance(String className) |
protected MethodProperty |
newMethodProperty(Method getter,
Method setter,
String name) |
protected static final int STATIC_TRANSIENT_MASK
protected static final int STATIC_PRIVATE_PROTECTED_MASK
protected static final Property NULL_PROPERTY
protected final ClassLoader classLoader
protected final BypassConstructorAllocator instanceFactory
protected final Comparator<Property> lexicalPropertyComparator
protected final ConcurrentMap<Class<?>,List<Property>> serializablePropertiesCache
protected final ConcurrentMap<Reflection.SinglePropertyKey,Property> singlePropertyCache
public Reflection(ClassLoader classLoader)
public Reflection(ClassLoader classLoader, BypassConstructorAllocator instanceFactory)
public ClassLoader getClassLoader()
public Class<?> loadClass(String className) throws ClassNotFoundException
ClassNotFoundExceptionpublic <T> T newInstance(Class<T> cls) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException, NoSuchMethodException
public <T> T newInstance(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException, NoSuchMethodException
public Property findSerializableProperty(Class<?> cls, String name) throws SecurityException
SecurityExceptionpublic List<Property> findSerializableProperties(Class<?> cls) throws SecurityException
SecurityExceptionprotected FieldProperty newFieldProperty(Field field)
protected MethodProperty newMethodProperty(Method getter, Method setter, String name)
protected List<Property> findSerializableDeclaredProperties(Class<?> cls) throws SecurityException
SecurityExceptionpublic boolean isRegularClass(Class<?> cls)
public Property findProperty(Class<?> cls, String name, Class<?> type)
public Property findProperty(Class<?> cls, Class<? extends Annotation> annotationClass)