Top Description Fields Constructors Methods
tools.jackson.dataformat.ion

public Class IonWriteContext

extends TokenStreamContext
Class Inheritance
Imports
tools.jackson.core.JsonGenerator, .TokenStreamContext, tools.jackson.core.exc.StreamWriteException, tools.jackson.core.json.DupDetector

Extension of TokenStreamContext that recognizes sexps

The TokenStreamContext is used by the pretty printer for handling of the whitespace between tokens, and by the generator for verifying whether it's valid to write a given token. The writeStartSexp method in the IonGenerator will enter a "sexp context", so we need a new state in the write context to track that. Sexp handling is modeled after arrays.

Field Summary

Modifier and TypeField and Description
protected IonWriteContext
protected String
_currentName

Name of the Object property of which value is to be written; only used for OBJECT contexts

protected Object
protected DupDetector
protected boolean
protected final IonWriteContext
_parent

Parent context for this context; null for root context.

public static final int
protected static final int
Inherited from tools.jackson.core.TokenStreamContext:
_index_nestingDepth_typeTYPE_ARRAYTYPE_OBJECTTYPE_ROOT

Constructor Summary

AccessConstructor and Description
protected
IonWriteContext(int type, IonWriteContext parent, int nestingDepth, DupDetector dups, Object currentValue)

Method Summary

Modifier and TypeMethod and Description
private final void
public void
assignCurrentValue(Object v)

Overrides tools.jackson.core.TokenStreamContext.assignCurrentValue.

Method to call to pass value to be returned via currentValue; typically called indirectly through JsonParser#assignCurrentValue or JsonGenerator#assignCurrentValue).

public IonWriteContext
public IonWriteContext
public IonWriteContext
public static IonWriteContext
public final String
currentName()

Implements abstract tools.jackson.core.TokenStreamContext.currentName.

Method for accessing name associated with the current location.

public Object
currentValue()

Overrides tools.jackson.core.TokenStreamContext.currentValue.

Method for accessing currently active value being used by data-binding (as the source of streaming data to write, or destination of data being read), at this level in hierarchy.

public final IonWriteContext
getParent()

Implements abstract tools.jackson.core.TokenStreamContext.getParent.

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

public boolean
public final boolean
private IonWriteContext
reset(int type, Object currentValue)

public boolean
public boolean
Inherited from tools.jackson.core.TokenStreamContext:
getCurrentIndexgetEntryCountgetNestingDepthhasCurrentIndexhasPathSegmentinArrayinObjectinRootpathAsPointerpathAsPointerstartLocationtoStringtypeDesc

Field Detail

_childback to summary
protected IonWriteContext _child
_currentNameback to summary
protected String _currentName

Name of the Object property of which value is to be written; only used for OBJECT contexts

_currentValueback to summary
protected Object _currentValue
_dupsback to summary
protected DupDetector _dups
_gotPropertyIdback to summary
protected boolean _gotPropertyId
_parentback to summary
protected final IonWriteContext _parent

Parent context for this context; null for root context.

STATUS_OK_AFTER_SEXP_SEPARATORback to summary
public static final int STATUS_OK_AFTER_SEXP_SEPARATOR
TYPE_SEXPback to summary
protected static final int TYPE_SEXP

Constructor Detail

IonWriteContextback to summary
protected IonWriteContext(int type, IonWriteContext parent, int nestingDepth, DupDetector dups, Object currentValue)

Method Detail

_checkDupback to summary
private final void _checkDup(DupDetector dd, String name) throws StreamWriteException
assignCurrentValueback to summary
public void assignCurrentValue(Object v)

Overrides tools.jackson.core.TokenStreamContext.assignCurrentValue.

Doc from tools.jackson.core.TokenStreamContext.assignCurrentValue.

Method to call to pass value to be returned via currentValue; typically called indirectly through JsonParser#assignCurrentValue or JsonGenerator#assignCurrentValue).

Annotations
@Override
createChildArrayContextback to summary
public IonWriteContext createChildArrayContext(Object currentValue)
createChildObjectContextback to summary
public IonWriteContext createChildObjectContext(Object currentValue)
createChildSexpContextback to summary
public IonWriteContext createChildSexpContext(Object currentValue)
createRootContextback to summary
public static IonWriteContext createRootContext(DupDetector dd)
currentNameback to summary
public final String currentName()

Implements abstract tools.jackson.core.TokenStreamContext.currentName.

Doc from tools.jackson.core.TokenStreamContext.currentName.

Method for accessing name associated with the current location. Non-null for PROPERTY_NAME and value events that directly follow Property names; null for root level and array values.

Annotations
@Override
currentValueback to summary
public Object currentValue()

Overrides tools.jackson.core.TokenStreamContext.currentValue.

Doc from tools.jackson.core.TokenStreamContext.currentValue.

Method for accessing currently active value being used by data-binding (as the source of streaming data to write, or destination of data being read), at this level in hierarchy.

Note that "current value" is NOT populated (or used) by Streaming parser or generator; it is only used by higher-level data-binding functionality. The reason it is included here is that it can be stored and accessed hierarchically, and gets passed through data-binding.

Annotations
@Override
getParentback to summary
public final IonWriteContext getParent()

Implements abstract tools.jackson.core.TokenStreamContext.getParent.

Doc from tools.jackson.core.TokenStreamContext.getParent.

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

Annotations
@Override
hasCurrentNameback to summary
public boolean hasCurrentName()

Overrides tools.jackson.core.TokenStreamContext.hasCurrentName.

Annotations
@Override
inSexpback to summary
public final boolean inSexp()
resetback to summary
private IonWriteContext reset(int type, Object currentValue)
writeNameback to summary
public boolean writeName(String name) throws StreamWriteException
writeValueback to summary
public boolean writeValue()