Package com.thoughtworks.xstream.converters.reflection

Examples of com.thoughtworks.xstream.converters.reflection.SortableFieldKeySorter


     * Constructs the persister and underlying xstream specifying the stream driver explicitly.
     */
    protected XStreamPersister(HierarchicalStreamDriver streamDriver) {
       
        //control the order in which fields are sorted
        SortableFieldKeySorter sorter = new SortableFieldKeySorter();
        sorter.registerFieldOrder( CatalogImpl.class, new String[]{ "workspaces", "namespaces", "stores", "styles",
            /* these we actually omit, but the sorter needs them specified */
            "layerGroups", "resources", "maps", "listeners", "layers""resourcePool", "resourceLoader", "LOGGER" } );
       
        ReflectionProvider reflectionProvider = new CustomReflectionProvider( new FieldDictionary( sorter ) );
            //new Sun14ReflectionProvider( new FieldDictionary( sorter  ) );
View Full Code Here


public class SortableFieldListTest extends AbstractAcceptanceTest {

  public void testSortsFieldOrderWithArray() {

    SortableFieldKeySorter sorter = new SortableFieldKeySorter();
    sorter.registerFieldOrder(MommyBear.class,
        new String[] { "b", "c", "a" });

    xstream = new XStream(new PureJavaReflectionProvider(new FieldDictionary(sorter)));

    xstream.alias("mommy", MommyBear.class);
View Full Code Here

        + "  <a>aaa</a>\n" + "</mommy>");
  }

  public void testSortsFieldOrderWhileUsingInheritance() {

    SortableFieldKeySorter sorter = new SortableFieldKeySorter();
    sorter.registerFieldOrder(BabyBear.class,
        new String[] { "b", "d", "c", "a" });

    xstream = new XStream(new PureJavaReflectionProvider(new FieldDictionary(sorter)));

    xstream.alias("baby", BabyBear.class);
View Full Code Here

     * Constructs the persister and underlying xstream specifying the stream driver explicitly.
     */
    protected XStreamPersister(HierarchicalStreamDriver streamDriver) {
       
        //control the order in which fields are sorted
        SortableFieldKeySorter sorter = new SortableFieldKeySorter();
        //sorter.registerFieldOrder( DefaultCatalogDAO.class, new String[]{ "workspaces", "namespaces", "stores", "styles",
            /* these we actually omit, but the sorter needs them specified */
        //    "layerGroups", "resources", "maps", "defaultStores", "listeners", "layers",  "resourcePool", "resourceLoader", "LOGGER" } );
       
        ReflectionProvider reflectionProvider = new CustomReflectionProvider( new FieldDictionary( sorter ) );
View Full Code Here

     * Constructs the persister and underlying xstream specifying the stream driver explicitly.
     */
    protected XStreamPersister(HierarchicalStreamDriver streamDriver) {
       
        //control the order in which fields are sorted
        SortableFieldKeySorter sorter = new SortableFieldKeySorter();
        //sorter.registerFieldOrder( DefaultCatalogDAO.class, new String[]{ "workspaces", "namespaces", "stores", "styles",
            /* these we actually omit, but the sorter needs them specified */
        //    "layerGroups", "resources", "maps", "defaultStores", "listeners", "layers",  "resourcePool", "resourceLoader", "LOGGER" } );
       
        ReflectionProvider reflectionProvider = new CustomReflectionProvider( new FieldDictionary( sorter ) );
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.converters.reflection.SortableFieldKeySorter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.