Top Description Fields Constructors Methods
tools.jackson.core.filter

public Class TokenFilterContext

extends TokenStreamContext
Class Inheritance
Imports
tools.jackson.core.*

Alternative variant of TokenStreamContext, used when filtering content being read or written (based on TokenFilter).

Field Summary

Modifier and TypeField and Description
protected TokenFilterContext
protected String
_currentName

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

protected Object
protected TokenFilter
_filter

Filter to use for items in this state (for properties of Objects, elements of Arrays, and root-level values of root context)

protected boolean
_needToHandleName

Flag that indicates that the current name of this context still needs to be read/written, if path from root down to included leaf is to be exposed.

protected final TokenFilterContext
_parent

Parent context for this context; null for root context.

protected boolean
_startHandled

Flag that indicates that start token has been read/written, so that matching close token needs to be read/written as well when context is getting closed.

Inherited from tools.jackson.core.TokenStreamContext:
_index_nestingDepth_typeTYPE_ARRAYTYPE_OBJECTTYPE_ROOT

Constructor Summary

AccessConstructor and Description
protected
TokenFilterContext(int type, TokenFilterContext parent, TokenFilter filter, Object currValue, boolean startHandled)

Method Summary

Modifier and TypeMethod and Description
private void
protected 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 TokenFilter

Returns:

Filter to use for value
checkValue
(TokenFilter
Currently active filter
filter
)

Method called to check whether value is to be included at current output position, either as Object property, Array element, or root value.

public TokenFilterContext
public TokenFilterContext
public TokenFilterContext
createChildArrayContext(TokenFilter filter, Object currentValue, boolean writeStart)

public TokenFilterContext
createChildObjectContext(TokenFilter filter, Object currentValue, boolean writeStart)

public static TokenFilterContext
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 void
ensurePropertyNameWritten(JsonGenerator
Generator to use to write the property name, if necessary
gen
)

Method called to ensure that the property name, if present, has been written; may result (but does not always) in a call using given generator

public TokenFilterContext
public TokenFilter
public final TokenFilterContext
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 boolean
public JsonToken
protected TokenFilterContext
reset(int type, TokenFilter filter, Object currValue, boolean startWritten)

public TokenFilter
public void
public String
toString()

Overrides tools.jackson.core.TokenStreamContext.toString.

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

public void
writePath(JsonGenerator
Generator to use to write the path, if necessary
gen
)

Method called to ensure that parent path from root is written up to and including this node.

Inherited from tools.jackson.core.TokenStreamContext:
getCurrentIndexgetEntryCountgetNestingDepthhasCurrentIndexhasPathSegmentinArrayinObjectinRootpathAsPointerpathAsPointerstartLocationtypeDesc

Field Detail

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

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

_currentValueback to summary
protected Object _currentValue
Since
3.0
_filterback to summary
protected TokenFilter _filter

Filter to use for items in this state (for properties of Objects, elements of Arrays, and root-level values of root context)

_needToHandleNameback to summary
protected boolean _needToHandleName

Flag that indicates that the current name of this context still needs to be read/written, if path from root down to included leaf is to be exposed.

_parentback to summary
protected final TokenFilterContext _parent

Parent context for this context; null for root context.

_startHandledback to summary
protected boolean _startHandled

Flag that indicates that start token has been read/written, so that matching close token needs to be read/written as well when context is getting closed.

Constructor Detail

TokenFilterContextback to summary
protected TokenFilterContext(int type, TokenFilterContext parent, TokenFilter filter, Object currValue, boolean startHandled)

Method Detail

_writePathback to summary
private void _writePath(JsonGenerator gen) throws JacksonException
appendDescback to summary
protected void appendDesc(StringBuilder sb)
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
checkValueback to summary
public TokenFilter checkValue(TokenFilter filter)

Method called to check whether value is to be included at current output position, either as Object property, Array element, or root value.

Parameters
filter:TokenFilter

Currently active filter

Returns:TokenFilter

Filter to use for value

closeArrayback to summary
public TokenFilterContext closeArray(JsonGenerator gen) throws JacksonException
closeObjectback to summary
public TokenFilterContext closeObject(JsonGenerator gen) throws JacksonException
createChildArrayContextback to summary
public TokenFilterContext createChildArrayContext(TokenFilter filter, Object currentValue, boolean writeStart)
createChildObjectContextback to summary
public TokenFilterContext createChildObjectContext(TokenFilter filter, Object currentValue, boolean writeStart)
createRootContextback to summary
public static TokenFilterContext createRootContext(TokenFilter filter)
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
ensurePropertyNameWrittenback to summary
public void ensurePropertyNameWritten(JsonGenerator gen) throws JacksonException

Method called to ensure that the property name, if present, has been written; may result (but does not always) in a call using given generator

Parameters
gen:JsonGenerator

Generator to use to write the property name, if necessary

Exceptions
JacksonException:
If there is a problem writing property name (typically thrown by JsonGenerator)
findChildOfback to summary
public TokenFilterContext findChildOf(TokenFilterContext parent)
getFilterback to summary
public TokenFilter getFilter()
getParentback to summary
public final TokenFilterContext 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
isStartHandledback to summary
public boolean isStartHandled()
nextTokenToReadback to summary
public JsonToken nextTokenToRead()
resetback to summary
protected TokenFilterContext reset(int type, TokenFilter filter, Object currValue, boolean startWritten)
setPropertyNameback to summary
public TokenFilter setPropertyName(String name)
skipParentChecksback to summary
public void skipParentChecks()
toStringback to summary
public String toString()

Overrides tools.jackson.core.TokenStreamContext.toString.

Doc from tools.jackson.core.TokenStreamContext.toString.

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

Annotations
@Override
writePathback to summary
public void writePath(JsonGenerator gen) throws JacksonException

Method called to ensure that parent path from root is written up to and including this node.

Parameters
gen:JsonGenerator

Generator to use to write the path, if necessary

Exceptions
JacksonException:
If there is a problem writing property name (typically thrown by JsonGenerator)