Class FieldDictionary

  • All Implemented Interfaces:
    Caching

    public class FieldDictionary
    extends java.lang.Object
    implements Caching
    A field dictionary instance caches information about classes fields.
    • Constructor Detail

      • FieldDictionary

        public FieldDictionary()
    • Method Detail

      • init

        private void init()
      • serializableFieldsFor

        public java.util.Iterator serializableFieldsFor​(java.lang.Class cls)
        Deprecated.
        As of 1.3, use fieldsFor(Class) instead
        Returns an iterator for all fields for some class
        Parameters:
        cls - the class you are interested on
        Returns:
        an iterator for its fields
      • fieldsFor

        public java.util.Iterator fieldsFor​(java.lang.Class cls)
        Returns an iterator for all fields for some class
        Parameters:
        cls - the class you are interested on
        Returns:
        an iterator for its fields
      • field

        public java.lang.reflect.Field field​(java.lang.Class cls,
                                             java.lang.String name,
                                             java.lang.Class definedIn)
        Returns an specific field of some class. If definedIn is null, it searches for the field named 'name' inside the class cls. If definedIn is different than null, tries to find the specified field name in the specified class cls which should be defined in class definedIn (either equals cls or a one of it's superclasses)
        Parameters:
        cls - the class where the field is to be searched
        name - the field name
        definedIn - the superclass (or the class itself) of cls where the field was defined
        Returns:
        the field itself
        Throws:
        ObjectAccessException - if no field can be found
      • fieldOrNull

        public java.lang.reflect.Field fieldOrNull​(java.lang.Class cls,
                                                   java.lang.String name,
                                                   java.lang.Class definedIn)
        Returns an specific field of some class. If definedIn is null, it searches for the field named 'name' inside the class cls. If definedIn is different than null, tries to find the specified field name in the specified class cls which should be defined in class definedIn (either equals cls or a one of it's superclasses)
        Parameters:
        cls - the class where the field is to be searched
        name - the field name
        definedIn - the superclass (or the class itself) of cls where the field was defined
        Returns:
        the field itself or null
        Since:
        1.4
      • buildMap

        private java.util.Map buildMap​(java.lang.Class type,
                                       boolean tupleKeyed)
      • flushCache

        public void flushCache()
        Specified by:
        flushCache in interface Caching
      • readResolve

        protected java.lang.Object readResolve()