Class ClassFieldMap

java.lang.Object
org.apache.velocity.util.introspection.ClassFieldMap

public class ClassFieldMap extends Object
A cache of introspection information for a specific class instance. Keys Field objects by the field names.
  • Field Details

    • debugReflection

      private static final boolean debugReflection
      Set true if you want to debug the reflection code
      See Also:
    • log

      private final org.slf4j.Logger log
      Class logger
    • clazz

      private final Class<?> clazz
      Class passed into the constructor used to as the basis for the Field map.
    • fieldCache

      private final Map<String,Field> fieldCache
      String --> Field map, the key is the field name
  • Constructor Details

    • ClassFieldMap

      public ClassFieldMap(Class<?> clazz, org.slf4j.Logger log)
      Standard constructor
      Parameters:
      clazz - The class for which this ClassMap gets constructed.
      log - logger
  • Method Details

    • getCachedClass

      public 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 Field findField(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 Map<String,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(Map<String,Field> fieldCache, Class<?> iface)
    • populateFieldCacheWith

      private void populateFieldCacheWith(Map<String,Field> fieldCache, Class<?> classToReflect)