Top Description Fields Constructors Methods
com.fasterxml.jackson.dataformat.csv.impl

public final Class SimpleTokenWriteContext

extends JsonStreamContext
Class Inheritance
Imports
com.fasterxml.jackson.core.*, com.fasterxml.jackson.core.json.DupDetector

Intermediate base context; for 2.x copied within CSV format codebase, in 3.0 will be part of jackson-core
Since
2.11

Field Summary

Modifier and TypeField and Description
protected SimpleTokenWriteContext
protected String
_currentName

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

protected Object
protected DupDetector
protected boolean
_gotFieldId

Marker used to indicate that we just wrote a field name and now expect a value to write

protected final SimpleTokenWriteContext
_parent

Parent context for this context; null for root context.

Inherited from com.fasterxml.jackson.core.JsonStreamContext:
_index_nestingDepth_typeTYPE_ARRAYTYPE_OBJECTTYPE_ROOT

Constructor Summary

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

Method Summary

Modifier and TypeMethod and Description
private final void
public SimpleTokenWriteContext
clearAndGetParent()

Method that can be used to both clear the accumulated references (specifically value set with setCurrentValue(Object)) that should not be retained, and returns parent (as would getParent() do).

public SimpleTokenWriteContext
public SimpleTokenWriteContext
public static SimpleTokenWriteContext
public final String
getCurrentName()

Implements abstract com.fasterxml.jackson.core.JsonStreamContext.getCurrentName.

Method for accessing name associated with the current location.

public Object
getCurrentValue()

Overrides com.fasterxml.jackson.core.JsonStreamContext.getCurrentValue.

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 DupDetector
public final SimpleTokenWriteContext
getParent()

Implements abstract com.fasterxml.jackson.core.JsonStreamContext.getParent.

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

public boolean
private SimpleTokenWriteContext
reset(int type, Object currentValue)

public void
setCurrentValue(Object
Current value to assign to this context
v
)

Overrides com.fasterxml.jackson.core.JsonStreamContext.setCurrentValue.

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

public SimpleTokenWriteContext
public boolean

Returns:

Ok if name writing should proceed
writeFieldName
(String name)

Method that writer is to call before it writes a field name.

public boolean
Inherited from com.fasterxml.jackson.core.JsonStreamContext:
getCurrentIndexgetEntryCountgetNestingDepthgetStartLocationgetTypeDeschasCurrentIndexhasPathSegmentinArrayinObjectinRootpathAsPointerpathAsPointerstartLocationtoStringtypeDesc

Field Detail

_childToRecycleback to summary
protected SimpleTokenWriteContext _childToRecycle
_currentNameback to summary
protected String _currentName

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

_currentValueback to summary
protected Object _currentValue
_dupsback to summary
protected DupDetector _dups
_gotFieldIdback to summary
protected boolean _gotFieldId

Marker used to indicate that we just wrote a field name and now expect a value to write

_parentback to summary
protected final SimpleTokenWriteContext _parent

Parent context for this context; null for root context.

Constructor Detail

SimpleTokenWriteContextback to summary
protected SimpleTokenWriteContext(int type, SimpleTokenWriteContext parent, DupDetector dups, Object currentValue)

Method Detail

_checkDupback to summary
private final void _checkDup(DupDetector dd, String name) throws JsonProcessingException
clearAndGetParentback to summary
public SimpleTokenWriteContext clearAndGetParent()

Method that can be used to both clear the accumulated references (specifically value set with setCurrentValue(Object)) that should not be retained, and returns parent (as would getParent() do). Typically called when closing the active context when encountering JsonToken#END_ARRAY or JsonToken#END_OBJECT.

createChildArrayContextback to summary
public SimpleTokenWriteContext createChildArrayContext(Object currentValue)
createChildObjectContextback to summary
public SimpleTokenWriteContext createChildObjectContext(Object currentValue)
createRootContextback to summary
public static SimpleTokenWriteContext createRootContext(DupDetector dd)
getCurrentNameback to summary
public final String getCurrentName()

Implements abstract com.fasterxml.jackson.core.JsonStreamContext.getCurrentName.

Doc from com.fasterxml.jackson.core.JsonStreamContext.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.

Returns:String

Current field name within context, if any; null if none

Annotations
@Override
getCurrentValueback to summary
public Object getCurrentValue()

Overrides com.fasterxml.jackson.core.JsonStreamContext.getCurrentValue.

Doc from com.fasterxml.jackson.core.JsonStreamContext.getCurrentValue.

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.

Returns:Object

Currently active value, if one has been assigned.

Annotations
@Override
getDupDetectorback to summary
public DupDetector getDupDetector()
getParentback to summary
public final SimpleTokenWriteContext getParent()

Implements abstract com.fasterxml.jackson.core.JsonStreamContext.getParent.

Doc from com.fasterxml.jackson.core.JsonStreamContext.getParent.

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

Returns:SimpleTokenWriteContext

Parent context of this context, if any; null for Root contexts

Annotations
@Override
hasCurrentNameback to summary
public boolean hasCurrentName()

Overrides com.fasterxml.jackson.core.JsonStreamContext.hasCurrentName.

Returns:boolean

Doc from com.fasterxml.jackson.core.JsonStreamContext.hasCurrentName.

True if a call to getCurrentName() would return non-null name; false otherwise

Annotations
@Override
resetback to summary
private SimpleTokenWriteContext reset(int type, Object currentValue)
setCurrentValueback to summary
public void setCurrentValue(Object v)

Overrides com.fasterxml.jackson.core.JsonStreamContext.setCurrentValue.

Doc from com.fasterxml.jackson.core.JsonStreamContext.setCurrentValue.

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

Parameters
v:Object

Current value to assign to this context

Annotations
@Override
withDupDetectorback to summary
public SimpleTokenWriteContext withDupDetector(DupDetector dups)
writeFieldNameback to summary
public boolean writeFieldName(String name) throws JsonProcessingException

Method that writer is to call before it writes a field name.

Returns:boolean

Ok if name writing should proceed

writeValueback to summary
public boolean writeValue()