org.qi4j.valueserialization.orgjson
Class OrgJsonValueSerializer

java.lang.Object
  extended by org.qi4j.spi.value.ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>
      extended by org.qi4j.valueserialization.orgjson.OrgJsonValueSerializer
All Implemented Interfaces:
ValueSerializer

public class OrgJsonValueSerializer
extends ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>

ValueSerializer producing Values state as JSON documents using org.json.


Nested Class Summary
static class OrgJsonValueSerializer.OrgJsonOutput
          Helper to pass around the Writer alongside the JSONWriter so we can flush it onSerializationEnd.
 
Constructor Summary
OrgJsonValueSerializer()
           
 
Method Summary
protected  OrgJsonValueSerializer.OrgJsonOutput adaptOutput(java.io.OutputStream output)
           
protected  void onArrayEnd(OrgJsonValueSerializer.OrgJsonOutput output)
           
protected  void onArrayStart(OrgJsonValueSerializer.OrgJsonOutput output)
           
protected  void onFieldStart(OrgJsonValueSerializer.OrgJsonOutput output, java.lang.String fieldName)
           
protected  void onObjectEnd(OrgJsonValueSerializer.OrgJsonOutput output)
           
protected  void onObjectStart(OrgJsonValueSerializer.OrgJsonOutput output)
           
protected  void onSerializationEnd(java.lang.Object object, OrgJsonValueSerializer.OrgJsonOutput output)
           
protected  void onValue(OrgJsonValueSerializer.OrgJsonOutput output, java.lang.Object value)
           
 
Methods inherited from class org.qi4j.spi.value.ValueSerializerAdapter
onFieldEnd, onSerializationStart, onValueEnd, onValueStart, registerSerializer, serialize, serialize, serialize, serialize, serialize, serialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrgJsonValueSerializer

public OrgJsonValueSerializer()
Method Detail

adaptOutput

protected OrgJsonValueSerializer.OrgJsonOutput adaptOutput(java.io.OutputStream output)
                                                    throws java.lang.Exception
Specified by:
adaptOutput in class ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>
Throws:
java.lang.Exception

onSerializationEnd

protected void onSerializationEnd(java.lang.Object object,
                                  OrgJsonValueSerializer.OrgJsonOutput output)
                           throws java.lang.Exception
Overrides:
onSerializationEnd in class ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>
Throws:
java.lang.Exception

onArrayStart

protected void onArrayStart(OrgJsonValueSerializer.OrgJsonOutput output)
                     throws java.lang.Exception
Specified by:
onArrayStart in class ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>
Throws:
java.lang.Exception

onArrayEnd

protected void onArrayEnd(OrgJsonValueSerializer.OrgJsonOutput output)
                   throws java.lang.Exception
Specified by:
onArrayEnd in class ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>
Throws:
java.lang.Exception

onObjectStart

protected void onObjectStart(OrgJsonValueSerializer.OrgJsonOutput output)
                      throws java.lang.Exception
Specified by:
onObjectStart in class ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>
Throws:
java.lang.Exception

onObjectEnd

protected void onObjectEnd(OrgJsonValueSerializer.OrgJsonOutput output)
                    throws java.lang.Exception
Specified by:
onObjectEnd in class ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>
Throws:
java.lang.Exception

onFieldStart

protected void onFieldStart(OrgJsonValueSerializer.OrgJsonOutput output,
                            java.lang.String fieldName)
                     throws java.lang.Exception
Specified by:
onFieldStart in class ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>
Throws:
java.lang.Exception

onValue

protected void onValue(OrgJsonValueSerializer.OrgJsonOutput output,
                       java.lang.Object value)
                throws java.lang.Exception
Specified by:
onValue in class ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>
Throws:
java.lang.Exception