Top Description Constructors Methods
com.thoughtworks.xstream.converters.reflection

public Class XStream12FieldKeySorter

extends Object
implements FieldKeySorter
Class Inheritance
All Implemented Interfaces
com.thoughtworks.xstream.converters.reflection.FieldKeySorter
Imports
java.util.Comparator, .Map, .TreeMap

Sort the fields in the order of XStream 1.2.x. Fields are returned in their declaration order, fields of base classes last.
Author
Jörg Schaible
Since
1.3

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Map<K, V>
sort(final Class<T>
the class that contains all the fields
type
,
final Map<K, V>
a Map containing a FieldKey as key element and a java.lang.reflect.Field as value.
keyedByFieldKey
)

Implements com.thoughtworks.xstream.converters.reflection.FieldKeySorter.sort.

Sort the fields of a type.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

XStream12FieldKeySorterback to summary
public XStream12FieldKeySorter()

Method Detail

sortback to summary
public Map<K, V> sort(final Class<T> type, final Map<K, V> keyedByFieldKey)

Implements com.thoughtworks.xstream.converters.reflection.FieldKeySorter.sort.

Doc from com.thoughtworks.xstream.converters.reflection.FieldKeySorter.sort.

Sort the fields of a type. The method will be called with the class type that contains all the fields and a Map that retains the order in which the elements have been added. The sequence in which elements are returned by an iterator defines the processing order of the fields. An implementation may create a different Map with similar semantic, add all elements of the original map and return the new one.

Parameters
type:Class<T>

the class that contains all the fields

keyedByFieldKey:Map<K, V>

a Map containing a FieldKey as key element and a java.lang.reflect.Field as value.

Returns:Map<K, V>

a Map with all the entries of the original Map