Examples of omitField()


Examples of com.thoughtworks.xstream.XStream.omitField()

        XStream xstream = new XStream();
        xstream.registerConverter(new JavaBeanConverter(xstream.getMapper()), XStream.PRIORITY_VERY_LOW);
        xstream.alias("types", TypesOfFields.class);
        xstream.omitField(TypesOfFields.class, "foo");
        xstream.omitField(TypesOfFields.class, "normal");

        TypesOfFields unmarshalledFields = (TypesOfFields)xstream.fromXML(xml)
        assertEquals(fields, unmarshalledFields);
    }
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.omitField()

        String expected = "<unsafeBean/>";

        XStream xstream = new XStream();
        xstream.registerConverter(new JavaBeanConverter(xstream.getMapper()), XStream.PRIORITY_VERY_LOW);
        xstream.alias("unsafeBean", UnsafeBean.class);
        xstream.omitField(UnsafeBean.class, "unsafe");
   
        String xml = xstream.toXML(bean);
        assertEquals(expected, xml);
    }
   
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.omitField()

    public void testDoesNotSerializeOmittedInheritedFields() {
        XStream xstream = new XStream();
        xstream.registerConverter(
            new JavaBeanConverter(xstream.getMapper()), XStream.PRIORITY_VERY_LOW);
        xstream.omitField(Person.class, "lastName");
        xstream.alias("man", Man.class);

        Man man = new Man("John", "Doe");
        String expected = ""
            + "<man>\n"
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.omitField()

    }
   
    public void testCanOmitFieldAtSerialization() {
        XStream xstream = new XStream();
        xstream.alias("simple", SimpleType.class);
        xstream.omitField(SimpleType.class, "two");
       
        String expected = ""
            + "<simple serialization=\"custom\">\n"
            + "  <simple>\n"
            + "    <default>\n"
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.omitField()

    }
   
    public void testCanOmitFieldAtDeserialization() {
        XStream xstream = new XStream();
        xstream.alias("simple", SimpleType.class);
        xstream.omitField(SimpleType.class, "two");
        xstream.omitField(SimpleType.class, "x");
       
        String xml = ""
            + "<simple serialization=\"custom\">\n"
            + "  <simple>\n"
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.omitField()

   
    public void testCanOmitFieldAtDeserialization() {
        XStream xstream = new XStream();
        xstream.alias("simple", SimpleType.class);
        xstream.omitField(SimpleType.class, "two");
        xstream.omitField(SimpleType.class, "x");
       
        String xml = ""
            + "<simple serialization=\"custom\">\n"
            + "  <simple>\n"
            + "    <default>\n"
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.omitField()

   
    public void testCanOmitInheritedFieldAtSerialization() {
        XStream xstream = new XStream();
        xstream.alias("extended", ExtendedType.class);
        xstream.alias("simple", SimpleType.class);
        xstream.omitField(SimpleType.class, "two");
       
        String expected = ""
            + "<extended serialization=\"custom\">\n"
            + "  <simple>\n"
            + "    <default>\n"
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.omitField()

   
    public void testCanOmitInheritedFieldAtDeserialization() {
        XStream xstream = new XStream();
        xstream.alias("extended", ExtendedType.class);
        xstream.alias("simple", SimpleType.class);
        xstream.omitField(SimpleType.class, "two");
        xstream.omitField(SimpleType.class, "x");
       
        String xml = ""
            + "<extended serialization=\"custom\">\n"
            + "  <simple>\n"
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.omitField()

    public void testCanOmitInheritedFieldAtDeserialization() {
        XStream xstream = new XStream();
        xstream.alias("extended", ExtendedType.class);
        xstream.alias("simple", SimpleType.class);
        xstream.omitField(SimpleType.class, "two");
        xstream.omitField(SimpleType.class, "x");
       
        String xml = ""
            + "<extended serialization=\"custom\">\n"
            + "  <simple>\n"
            + "    <default>\n"
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.omitField()

    }
   
    public void testCanOmitNamedFieldAtSerialization() {
        XStream xstream = new XStream();
        xstream.alias("simple", SimpleNamedFieldsType.class);
        xstream.omitField(SimpleNamedFieldsType.class, "s2");
       
        String expected = ""
            + "<simple serialization=\"custom\">\n"
            + "  <simple>\n"
            + "    <default>\n"
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.