Package org.qi4j.api.json

Examples of org.qi4j.api.json.JSONWriterSerializer


    public String toString()
    {
        StringWriter string = new StringWriter( );
        try
        {
            new JSONWriterSerializer( string ).serialize( this.<ValueComposite>proxy() );
        }
        catch( JSONException e )
        {
            throw new IllegalStateException( "Could not JSON serialize value", e );
        }
View Full Code Here


                key( "type" ).value( state.entityDescriptor().type().getName() ).
                key( "version" ).value( identity ).
                key( "modified" ).value( lastModified ).
                key( "properties" ).object();
            EntityDescriptor entityType = state.entityDescriptor();
            JSONWriterSerializer serializer = new JSONWriterSerializer( json );
            for( PropertyDescriptor persistentProperty : entityType.state().properties() )
            {
                Object value = state.properties().get( persistentProperty.qualifiedName() );
                json.key( persistentProperty.qualifiedName().name() );
                serializer.serialize( value, persistentProperty.valueType() );
            }

            JSONWriter associations = properties.endObject().key( "associations" ).object();
            for( Map.Entry<QualifiedName, EntityReference> stateNameEntityReferenceEntry : state.associations()
                .entrySet() )
View Full Code Here

TOP

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

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.