public class

JsonWriteContext

extends JsonStreamContext
java.lang.Object
   ↳ com.fasterxml.jackson.core.JsonStreamContext
     ↳ com.fasterxml.jackson.core.json.JsonWriteContext

Class Overview

Extension of JsonStreamContext, which implements core methods needed, and also exposes more complete API to generator implementation classes.

Summary

Constants
int STATUS_EXPECT_NAME
int STATUS_EXPECT_VALUE
int STATUS_OK_AFTER_COLON
int STATUS_OK_AFTER_COMMA
int STATUS_OK_AFTER_SPACE
int STATUS_OK_AS_IS
[Expand]
Inherited Constants
From class com.fasterxml.jackson.core.JsonStreamContext
Fields
protected JsonWriteContext _child
protected String _currentName Name of the field of which value is to be parsed; only used for OBJECT contexts
protected final JsonWriteContext _parent
[Expand]
Inherited Fields
From class com.fasterxml.jackson.core.JsonStreamContext
Protected Constructors
JsonWriteContext(int type, JsonWriteContext parent)
Public Methods
final JsonWriteContext createChildArrayContext()
final JsonWriteContext createChildObjectContext()
static JsonWriteContext createRootContext()
final String getCurrentName()
Method for accessing name associated with the current location.
final JsonWriteContext getParent()
Accessor for finding parent context of this context; will return null for root context.
final String toString()
Overridden to provide developer writeable "JsonPath" representation of the context.
final int writeFieldName(String name)
Method that writer is to call before it writes a field name.
final int writeValue()
Protected Methods
final void appendDesc(StringBuilder sb)
[Expand]
Inherited Methods
From class com.fasterxml.jackson.core.JsonStreamContext
From class java.lang.Object

Constants

public static final int STATUS_EXPECT_NAME

Constant Value: 5 (0x00000005)

public static final int STATUS_EXPECT_VALUE

Constant Value: 4 (0x00000004)

public static final int STATUS_OK_AFTER_COLON

Constant Value: 2 (0x00000002)

public static final int STATUS_OK_AFTER_COMMA

Constant Value: 1 (0x00000001)

public static final int STATUS_OK_AFTER_SPACE

Constant Value: 3 (0x00000003)

public static final int STATUS_OK_AS_IS

Constant Value: 0 (0x00000000)

Fields

protected JsonWriteContext _child

protected String _currentName

Name of the field of which value is to be parsed; only used for OBJECT contexts

protected final JsonWriteContext _parent

Protected Constructors

protected JsonWriteContext (int type, JsonWriteContext parent)

Public Methods

public final JsonWriteContext createChildArrayContext ()

public final JsonWriteContext createChildObjectContext ()

public static JsonWriteContext createRootContext ()

public final String getCurrentName ()

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.

public final JsonWriteContext getParent ()

Accessor for finding parent context of this context; will return null for root context.

public final String toString ()

Overridden to provide developer writeable "JsonPath" representation of the context.

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)

public final int writeValue ()

Protected Methods

protected final void appendDesc (StringBuilder sb)