Package org.qi4j.api.json

Examples of org.qi4j.api.json.JSONObjectSerializer


    @Test
    public void givenLocalDateTypeWhenConvertingToJsonExpectValidString()
        throws Exception
    {
        JSONObjectSerializer serializer = new JSONObjectSerializer();
        serializer.serialize( new DateTime( "2020-03-04T13:24:35", DateTimeZone.UTC ), underTest );
        Object value = serializer.getRoot();
        assertEquals( "2020-03-04T13:24:35.000Z", value.toString());
    }
View Full Code Here


        // Use JSON serialization-deserialization to make a copy of it
        Object value = null;
        try
        {
            JSONObjectSerializer serializer = new JSONObjectSerializer();
            serializer.serialize( prototype, model.model().valueType() );
            Object object = serializer.getRoot();

            JSONDeserializer deserializer = new JSONDeserializer( model.module() );
            value = deserializer.deserialize( object, model.model().valueType() );
        } catch( JSONException e )
        {
View Full Code Here

            else
            {
                PropertyDescriptor persistentPropertyDescriptor = entityDescriptor.state()
                    .getPropertyByQualifiedName( stateName );

                JSONObjectSerializer serializer = new JSONObjectSerializer();
                serializer.serialize( newValue, persistentPropertyDescriptor.valueType() );
                jsonValue = serializer.getRoot();
            }
            cloneStateIfGlobalStateLoaded();
            state.getJSONObject( JSON_KEY_PROPERTIES ).put( stateName.name(), jsonValue );
            markUpdated();
        }
View Full Code Here

TOP

Related Classes of org.qi4j.api.json.JSONObjectSerializer

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.