Package flexjson.factories

Examples of flexjson.factories.BooleanAsStringObjectFactory


        assertEquals( expectedYes, json );
        spiderman.spideySense = false;
        json = new JSONSerializer().transform( new BooleanAsStringTransformer("yes", "no"), Boolean.class ).serialize(spiderman);
        assertEquals( expectedNo, json );

        spiderman = new JSONDeserializer<Spiderman>().use(Boolean.class, new BooleanAsStringObjectFactory("yes", "no")).deserialize(expectedYes, Spiderman.class);
        assertTrue( "Assert it deserialized yes into true", spiderman.spideySense );
        spiderman = new JSONDeserializer<Spiderman>().use(Boolean.class, new BooleanAsStringObjectFactory("yes", "no")).deserialize( expectedNo, Spiderman.class );
        assertFalse("Assert it deserialized no into false", spiderman.spideySense);
    }
View Full Code Here

TOP

Related Classes of flexjson.factories.BooleanAsStringObjectFactory

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.