Class JsonWriteContext

java.lang.Object
org.codehaus.jackson.JsonStreamContext
org.codehaus.jackson.impl.JsonWriteContext

public class JsonWriteContext extends JsonStreamContext
Extension of JsonStreamContext, which implements core methods needed, and also exposes more complete API to generator implementation classes.
  • Field Details

  • Constructor Details

    • JsonWriteContext

      protected JsonWriteContext(int type, JsonWriteContext parent)
  • Method Details

    • createRootContext

      public static JsonWriteContext createRootContext()
    • createChildArrayContext

      public final JsonWriteContext createChildArrayContext()
    • createChildObjectContext

      public final JsonWriteContext createChildObjectContext()
    • getParent

      public final JsonWriteContext getParent()
      Description copied from class: JsonStreamContext
      Accessor for finding parent context of this context; will return null for root context.
      Specified by:
      getParent in class JsonStreamContext
    • getCurrentName

      public final String getCurrentName()
      Description copied from class: JsonStreamContext
      Method for accessing name associated with the current location. Non-null for FIELD_NAME and value events that directly follow field names; null for root level and array values.
      Specified by:
      getCurrentName in class JsonStreamContext
    • writeFieldName

      public final int writeFieldName(String name)
      Method that writer is to call before it writes a field name.
      Returns:
      Index of the field entry (0-based)
    • writeValue

      public final int writeValue()
    • appendDesc

      protected final void appendDesc(StringBuilder sb)
    • toString

      public final String toString()
      Overridden to provide developer writeable "JsonPath" representation of the context.
      Overrides:
      toString in class Object