Examples of PureJavaReflectionProvider


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

* @author Jörg Schaible
*/
public class CustomFieldKeySorterTest extends AbstractAcceptanceTest {

    protected XStream createXStream() {
        return new XStream(new PureJavaReflectionProvider(new FieldDictionary(
            new AlphabeticalFieldkeySorter())));
    }
View Full Code Here

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

        sm.addPermission(source, new ReflectPermission("suppressAccessChecks"));
        sm.addPermission(source, new NetPermission("specifyStreamHandler"));
        sm.setReadOnly();
        System.setSecurityManager(sm);

        xstream = new XStream(new PureJavaReflectionProvider());

        assertBothWays();
    }
View Full Code Here

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

        sm.addPermission(source, new NetPermission("specifyStreamHandler"));
        sm.addPermission(source, new ReflectPermission("suppressAccessChecks"));
        sm.setReadOnly();
        System.setSecurityManager(sm);

        xstream = new XStream(new PureJavaReflectionProvider(), new DomDriver());

        assertBothWays();
    }
View Full Code Here

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

        assertEquals(expectedXml, xstream.toXML(new Software("ms", "word")));
    }
   
    public void testOwnMapperChainCanBeRegistered() {
        Mapper mapper = new DefaultMapper(getClass().getClassLoader());
        xstream = new XStream(new PureJavaReflectionProvider(), new DomDriver(), getClass().getClassLoader(), mapper);
       
        String expected = "" +
                "<com.thoughtworks.acceptance.objects.Software>\n" +
                "  <vendor>ms</vendor>\n" +
                "  <name>word</name>\n" +
View Full Code Here

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

    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);
    MommyBear root = new MommyBear();
    root.c = "ccc";
    root.b = "bbb";
View Full Code Here

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

    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);
    BabyBear root = new BabyBear();
    root.c = "ccc";
    root.b = "bbb";
View Full Code Here

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

                "  <number>9</number>\n" +
                "</thing>");
    }

    public void testExceptionThrownUponSerializationIfNotSupport() {
        xstream = new XStream(new PureJavaReflectionProvider());
        xstream.alias("thing", ThingWithFinalField.class);

        try {
            xstream.toXML(new ThingWithFinalField());
            if (!JVM.is15()) {
View Full Code Here

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

            try {
                if ( canUseSun14ReflectionProvider() ) {
                    String cls = "com.thoughtworks.xstream.converters.reflection.Sun14ReflectionProvider";
                    reflectionProvider = (ReflectionProvider) loadClass(cls).newInstance();
                } else {
                    reflectionProvider = new PureJavaReflectionProvider();
                }
            } catch (InstantiationException e) {
                reflectionProvider = new PureJavaReflectionProvider();
            } catch (IllegalAccessException e) {
                reflectionProvider = new PureJavaReflectionProvider();
            } catch (AccessControlException e) {
                // thrown when trying to access sun.misc package in Applet context.
                reflectionProvider = new PureJavaReflectionProvider();
            }
        }
        return reflectionProvider;
    }
View Full Code Here

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

  private VRaptorClassMapper vraptorMapper;

  {setMode(NO_REFERENCES);}

  public VRaptorXStream(TypeNameExtractor extractor) {
    super(new PureJavaReflectionProvider());
    this.extractor = extractor;
  }
View Full Code Here

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

  public VRaptorXStream(TypeNameExtractor extractor) {
    super(new PureJavaReflectionProvider());
    this.extractor = extractor;
  }
  public VRaptorXStream(TypeNameExtractor extractor, HierarchicalStreamDriver hierarchicalStreamDriver) {
    super(new PureJavaReflectionProvider(),hierarchicalStreamDriver);
    this.extractor = extractor;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.