Class ClassFieldMap
- java.lang.Object
-
- org.apache.velocity.util.introspection.ClassFieldMap
-
public class ClassFieldMap extends java.lang.Object
A cache of introspection information for a specific class instance. KeysField
objects by the field names.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class<?>
clazz
Class passed into the constructor used to as the basis for the Field map.private static boolean
debugReflection
Set true if you want to debug the reflection codeprivate java.util.Map<java.lang.String,java.lang.reflect.Field>
fieldCache
String --> Field map, the key is the field nameprivate org.slf4j.Logger
log
Class logger
-
Constructor Summary
Constructors Constructor Description ClassFieldMap(java.lang.Class<?> clazz, org.slf4j.Logger log)
Standard constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.Map<java.lang.String,java.lang.reflect.Field>
createFieldCache()
Populate the Map of direct hits.java.lang.reflect.Field
findField(java.lang.String name)
Find a Field using the field name.java.lang.Class<?>
getCachedClass()
Returns the class object whose fields are cached by this map.private void
populateFieldCacheWith(java.util.Map<java.lang.String,java.lang.reflect.Field> fieldCache, java.lang.Class<?> classToReflect)
private void
populateFieldCacheWithInterface(java.util.Map<java.lang.String,java.lang.reflect.Field> fieldCache, java.lang.Class<?> iface)
-
-
-
Field Detail
-
debugReflection
private static final boolean debugReflection
Set true if you want to debug the reflection code- See Also:
- Constant Field Values
-
log
private final org.slf4j.Logger log
Class logger
-
clazz
private final java.lang.Class<?> clazz
Class passed into the constructor used to as the basis for the Field map.
-
fieldCache
private final java.util.Map<java.lang.String,java.lang.reflect.Field> fieldCache
String --> Field map, the key is the field name
-
-
Method Detail
-
getCachedClass
public java.lang.Class<?> getCachedClass()
Returns the class object whose fields are cached by this map.- Returns:
- The class object whose fields are cached by this map.
-
findField
public java.lang.reflect.Field findField(java.lang.String name)
Find a Field using the field name.- Parameters:
name
- The field name to look up.- Returns:
- A Field object representing the field to invoke or null.
-
createFieldCache
private java.util.Map<java.lang.String,java.lang.reflect.Field> createFieldCache()
Populate the Map of direct hits. These are taken from all the public fields that our class, its parents and their implemented interfaces provide.
-
populateFieldCacheWithInterface
private void populateFieldCacheWithInterface(java.util.Map<java.lang.String,java.lang.reflect.Field> fieldCache, java.lang.Class<?> iface)
-
populateFieldCacheWith
private void populateFieldCacheWith(java.util.Map<java.lang.String,java.lang.reflect.Field> fieldCache, java.lang.Class<?> classToReflect)
-
-