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

public Class NativePropertySorter

extends Object
implements PropertySorter
Class Inheritance
All Implemented Interfaces
com.thoughtworks.xstream.converters.javabean.PropertySorter
Imports
java.util.Map

A sorter that keeps the natural order of the bean properties as they are returned by the JavaBean introspection.
Author
Jörg Schaible
Since
1.4

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Map<K, V>
sort(final Class<T>
the bean class that contains all the properties
type
,
final Map<K, V>
the map to sort, key is the property name, value the PropertyDescriptor
nameMap
)

Implements com.thoughtworks.xstream.converters.javabean.PropertySorter.sort.

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

Constructor Detail

NativePropertySorterback to summary
public NativePropertySorter()

Method Detail

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

Implements com.thoughtworks.xstream.converters.javabean.PropertySorter.sort.

Doc from com.thoughtworks.xstream.converters.javabean.PropertySorter.sort.

Sort the properties of a bean type. The method will be called with the class type that contains all the properties 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 properties. 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 bean class that contains all the properties

nameMap:Map<K, V>

the map to sort, key is the property name, value the PropertyDescriptor

Returns:Map<K, V>

the sorted nameMap