Class FieldDictionary
- java.lang.Object
-
- com.thoughtworks.xstream.converters.reflection.FieldDictionary
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classFieldDictionary.DictionaryEntry(package private) static interfaceFieldDictionary.FieldUtil
-
Field Summary
Fields Modifier and Type Field Description private java.util.MapdictionaryEntriesprivate FieldDictionary.FieldUtilfieldUtilprivate static FieldDictionary.DictionaryEntryOBJECT_DICTIONARY_ENTRYprivate FieldKeySortersorter
-
Constructor Summary
Constructors Constructor Description FieldDictionary()FieldDictionary(FieldKeySorter sorter)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private FieldDictionary.DictionaryEntrybuildDictionaryEntryForClass(java.lang.Class cls, FieldDictionary.DictionaryEntry lastDictionaryEntry)private java.util.MapbuildMap(java.lang.Class type, boolean tupleKeyed)java.lang.reflect.Fieldfield(java.lang.Class cls, java.lang.String name, java.lang.Class definedIn)Returns an specific field of some class.java.lang.reflect.FieldfieldOrNull(java.lang.Class cls, java.lang.String name, java.lang.Class definedIn)Returns an specific field of some class.java.util.IteratorfieldsFor(java.lang.Class cls)Returns an iterator for all fields for some classvoidflushCache()private FieldDictionary.DictionaryEntrygetDictionaryEntry(java.lang.Class cls)private voidinit()protected java.lang.ObjectreadResolve()java.util.IteratorserializableFieldsFor(java.lang.Class cls)Deprecated.As of 1.3, usefieldsFor(Class)instead
-
-
-
Field Detail
-
OBJECT_DICTIONARY_ENTRY
private static final FieldDictionary.DictionaryEntry OBJECT_DICTIONARY_ENTRY
-
dictionaryEntries
private transient java.util.Map dictionaryEntries
-
fieldUtil
private transient FieldDictionary.FieldUtil fieldUtil
-
sorter
private final FieldKeySorter sorter
-
-
Constructor Detail
-
FieldDictionary
public FieldDictionary()
-
FieldDictionary
public FieldDictionary(FieldKeySorter sorter)
-
-
Method Detail
-
init
private void init()
-
serializableFieldsFor
public java.util.Iterator serializableFieldsFor(java.lang.Class cls)
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
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 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
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 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
private java.util.Map buildMap(java.lang.Class type, boolean tupleKeyed)
-
buildDictionaryEntryForClass
private FieldDictionary.DictionaryEntry buildDictionaryEntryForClass(java.lang.Class cls, FieldDictionary.DictionaryEntry lastDictionaryEntry)
-
getDictionaryEntry
private FieldDictionary.DictionaryEntry getDictionaryEntry(java.lang.Class cls)
-
flushCache
public void flushCache()
- Specified by:
flushCachein interfaceCaching
-
readResolve
protected java.lang.Object readResolve()
-
-