Class FieldDictionary
java.lang.Object
com.thoughtworks.xstream.converters.reflection.FieldDictionary
- All Implemented Interfaces:
Caching
A field dictionary instance caches information about classes fields.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
(package private) static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map
private FieldDictionary.FieldUtil
private static final FieldDictionary.DictionaryEntry
private final FieldKeySorter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate FieldDictionary.DictionaryEntry
buildDictionaryEntryForClass
(Class cls, FieldDictionary.DictionaryEntry lastDictionaryEntry) private Map
Returns an specific field of some class.fieldOrNull
(Class cls, String name, Class definedIn) Returns an specific field of some class.Returns an iterator for all fields for some classvoid
private FieldDictionary.DictionaryEntry
getDictionaryEntry
(Class cls) private void
init()
protected Object
Deprecated.
-
Field Details
-
OBJECT_DICTIONARY_ENTRY
-
dictionaryEntries
-
fieldUtil
-
sorter
-
-
Constructor Details
-
FieldDictionary
public FieldDictionary() -
FieldDictionary
-
-
Method Details
-
init
private void init() -
serializableFieldsFor
Deprecated.As of 1.3, usefieldsFor(Class)
insteadReturns an iterator for all fields for some class- Parameters:
cls
- the class you are interested on- Returns:
- an iterator for its fields
-
fieldsFor
Returns an iterator for all fields for some class- Parameters:
cls
- the class you are interested on- Returns:
- an iterator for its fields
-
field
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 searchedname
- the field namedefinedIn
- 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
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 searchedname
- the field namedefinedIn
- the superclass (or the class itself) of cls where the field was defined- Returns:
- the field itself or
null
- Since:
- 1.4
-
buildMap
-
buildDictionaryEntryForClass
private FieldDictionary.DictionaryEntry buildDictionaryEntryForClass(Class cls, FieldDictionary.DictionaryEntry lastDictionaryEntry) -
getDictionaryEntry
-
flushCache
public void flushCache()- Specified by:
flushCache
in interfaceCaching
-
readResolve
-
fieldsFor(Class)
instead