org.codehaus.jackson.impl
Class JsonWriteContext

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

public abstract class JsonWriteContext
extends JsonStreamContext

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


Field Summary
protected  JsonWriteContext _parent
           
static int STATUS_EXPECT_NAME
           
static int STATUS_EXPECT_VALUE
           
static int STATUS_OK_AFTER_COLON
           
static int STATUS_OK_AFTER_COMMA
           
static int STATUS_OK_AFTER_SPACE
           
static int STATUS_OK_AS_IS
           
 
Fields inherited from class org.codehaus.jackson.JsonStreamContext
_index, _type, TYPE_ARRAY, TYPE_OBJECT, TYPE_ROOT
 
Constructor Summary
protected JsonWriteContext(int type, JsonWriteContext parent)
           
 
Method Summary
protected abstract  void appendDesc(StringBuilder sb)
           
 JsonWriteContext createChildArrayContext()
           
 JsonWriteContext createChildObjectContext()
           
static JsonWriteContext createRootContext()
           
 JsonWriteContext getParent()
           
 String toString()
          Overridden to provide developer writeable "JsonPath" representation of the context.
abstract  int writeFieldName(String name)
          Method that writer is to call before it writes a field name.
abstract  int writeValue()
           
 
Methods inherited from class org.codehaus.jackson.JsonStreamContext
getCurrentIndex, getCurrentName, getEntryCount, getTypeDesc, inArray, inObject, inRoot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATUS_OK_AS_IS

public static final int STATUS_OK_AS_IS
See Also:
Constant Field Values

STATUS_OK_AFTER_COMMA

public static final int STATUS_OK_AFTER_COMMA
See Also:
Constant Field Values

STATUS_OK_AFTER_COLON

public static final int STATUS_OK_AFTER_COLON
See Also:
Constant Field Values

STATUS_OK_AFTER_SPACE

public static final int STATUS_OK_AFTER_SPACE
See Also:
Constant Field Values

STATUS_EXPECT_VALUE

public static final int STATUS_EXPECT_VALUE
See Also:
Constant Field Values

STATUS_EXPECT_NAME

public static final int STATUS_EXPECT_NAME
See Also:
Constant Field Values

_parent

protected final JsonWriteContext _parent
Constructor Detail

JsonWriteContext

protected JsonWriteContext(int type,
                           JsonWriteContext parent)
Method Detail

createRootContext

public static JsonWriteContext createRootContext()

createChildArrayContext

public final JsonWriteContext createChildArrayContext()

createChildObjectContext

public final JsonWriteContext createChildObjectContext()

getParent

public final JsonWriteContext getParent()
Specified by:
getParent in class JsonStreamContext

writeFieldName

public abstract 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 abstract int writeValue()

appendDesc

protected abstract void appendDesc(StringBuilder sb)

toString

public final String toString()
Overridden to provide developer writeable "JsonPath" representation of the context.

Overrides:
toString in class Object