org.qi4j.valueserialization.orgjson

## Class OrgJsonValueSerializer

- java.lang.Object
- - org.qi4j.spi.value.ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>
  - - 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

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `OrgJsonValueSerializer.OrgJsonOutput` Helper to pass around the Writer alongside the JSONWriter so we can flush it onSerializationEnd.

    - ### Nested classes/interfaces inherited from class org.qi4j.spi.value.ValueSerializerAdapter

      `ValueSerializerAdapter.ComplexSerializer<T,OutputType>`

    - ### Nested classes/interfaces inherited from interface org.qi4j.api.value.ValueSerializer

      `ValueSerializer.Options`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OrgJsonValueSerializer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected OrgJsonValueSerializer.OrgJsonOutput` | `adaptOutput(OutputStream output)`
    `protected void` | `onArrayEnd(OrgJsonValueSerializer.OrgJsonOutput output)`
    `protected void` | `onArrayStart(OrgJsonValueSerializer.OrgJsonOutput output)`
    `protected void` | `onFieldStart(OrgJsonValueSerializer.OrgJsonOutput output, String fieldName)`
    `protected void` | `onObjectEnd(OrgJsonValueSerializer.OrgJsonOutput output)`
    `protected void` | `onObjectStart(OrgJsonValueSerializer.OrgJsonOutput output)`
    `protected void` | `onSerializationEnd(Object object, OrgJsonValueSerializer.OrgJsonOutput output)`
    `protected void` | `onValue(OrgJsonValueSerializer.OrgJsonOutput output, Object value)`

    - ### Methods inherited from class org.qi4j.spi.value.ValueSerializerAdapter

      `onFieldEnd, onSerializationStart, onValueEnd, onValueStart, registerComplexSerializer, registerSerializer, serialize, serialize, serialize, 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(OutputStream output)
                                                              throws Exception

      Specified by:
        `adaptOutput` in class `ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>`
      Throws:
        `Exception`

    - #### onSerializationEnd

          protected void onSerializationEnd(Object object,
                                OrgJsonValueSerializer.OrgJsonOutput output)
                                     throws Exception

      Overrides:
        `onSerializationEnd` in class `ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>`
      Throws:
        `Exception`

    - #### onArrayStart

          protected void onArrayStart(OrgJsonValueSerializer.OrgJsonOutput output)
                               throws Exception

      Specified by:
        `onArrayStart` in class `ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>`
      Throws:
        `Exception`

    - #### onArrayEnd

          protected void onArrayEnd(OrgJsonValueSerializer.OrgJsonOutput output)
                             throws Exception

      Specified by:
        `onArrayEnd` in class `ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>`
      Throws:
        `Exception`

    - #### onObjectStart

          protected void onObjectStart(OrgJsonValueSerializer.OrgJsonOutput output)
                                throws Exception

      Specified by:
        `onObjectStart` in class `ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>`
      Throws:
        `Exception`

    - #### onObjectEnd

          protected void onObjectEnd(OrgJsonValueSerializer.OrgJsonOutput output)
                              throws Exception

      Specified by:
        `onObjectEnd` in class `ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>`
      Throws:
        `Exception`

    - #### onFieldStart

          protected void onFieldStart(OrgJsonValueSerializer.OrgJsonOutput output,
                          String fieldName)
                               throws Exception

      Specified by:
        `onFieldStart` in class `ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>`
      Throws:
        `Exception`

    - #### onValue

          protected void onValue(OrgJsonValueSerializer.OrgJsonOutput output,
                     Object value)
                          throws Exception

      Specified by:
        `onValue` in class `ValueSerializerAdapter<OrgJsonValueSerializer.OrgJsonOutput>`
      Throws:
        `Exception`