Class NativePropertySorter

java.lang.Object
com.thoughtworks.xstream.converters.javabean.NativePropertySorter
All Implemented Interfaces:
PropertySorter

public class NativePropertySorter extends Object implements PropertySorter
A sorter that keeps the natural order of the bean properties as they are returned by the JavaBean introspection.
Since:
1.4
  • Constructor Details

    • NativePropertySorter

      public NativePropertySorter()
  • Method Details

    • sort

      public Map sort(Class type, Map nameMap)
      Description copied from interface: PropertySorter
      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.
      Specified by:
      sort in interface PropertySorter
      Parameters:
      type - the bean class that contains all the properties
      nameMap - the map to sort, key is the property name, value the PropertyDescriptor
      Returns:
      the sorted nameMap