class ReflectionCache extends Object
Reflection.
java.lang.reflect methods can take a bit of time. Let's try to use some cache !| Modifier and Type | Field and Description |
|---|---|
private static org.apache.commons.collections4.MultiValuedMap<Class,Field> |
DECLARED_FIELDS
Declared fields for a given class
|
private static Map<Class<?>,Class<?>> |
KNOWN_IMPLEMENTATIONS
Reference implementations for common interfaces
|
| Constructor and Description |
|---|
ReflectionCache() |
| Modifier and Type | Method and Description |
|---|---|
(package private) static Collection<Field> |
getDeclaredFields(Class clazz) |
(package private) static <T> Class<? extends T> |
implementationOf(Class<T> clazz)
Returns the first known implementation of a class.
|
private static final org.apache.commons.collections4.MultiValuedMap<Class,Field> DECLARED_FIELDS
static Collection<Field> getDeclaredFields(Class clazz)
static <T> Class<? extends T> implementationOf(Class<T> clazz)
Reflection.isConcrete(Class).
KNOWN_IMPLEMENTATIONS has a reference implementation → go for itReflections to find all the subtypes in the whole context.
KNOWN_IMPLEMENTATIONS and return !
T - the class generic typeclazz - the class whose implementation is soughtCopyright © 2019. All rights reserved.