Top Description Fields Constructors Methods
tools.jackson.dataformat.xml.deser

public final Class XmlReadContext

extends TokenStreamContext
Class Inheritance
Imports
java.util.Set, tools.jackson.core.*, tools.jackson.core.io.CharTypes, .ContentReference

Extension of TokenStreamContext, which implements core methods needed, and adds small amount of additional state data we need.

Almost same as standard JsonReaderContext, but custom version needed to be able to keep track of names of properties that need wrapping; this is needed to support wrapped/unwrapped Collection/array values.

Field Summary

Modifier and TypeField and Description
protected XmlReadContext
protected int
protected String
protected Object
protected int
protected Set<String>
protected final XmlReadContext
protected String
_wrappedName

Name of property that requires wrapping

Inherited from tools.jackson.core.TokenStreamContext:
_index_nestingDepth_typeTYPE_ARRAYTYPE_OBJECTTYPE_ROOT

Constructor Summary

AccessConstructor and Description
public
XmlReadContext(int type, XmlReadContext parent, int nestingDepth, int lineNr, int colNr)

Method Summary

Modifier and TypeMethod and Description
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).

protected void
public final XmlReadContext
createChildArrayContext(int lineNr, int colNr)

public final XmlReadContext
createChildObjectContext(int lineNr, int colNr)

public static XmlReadContext
createRootContext(int lineNr, int colNr)

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 XmlReadContext
getParent()

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

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

public boolean
protected final void
reset(int type, int lineNr, int colNr)

public void
public void
setNamesToWrap(Set<String> namesToWrap)

public boolean
shouldWrap(String localName)

public final TokenStreamLocation

Returns:

Location pointing to the point where the context start marker was found
startLocation
(ContentReference srcRef)

Overrides tools.jackson.core.TokenStreamContext.startLocation.

Optional method that may be used to access starting location of this context: for example, in case of JSON `Object` context, offset at which `[` token was read or written.

public final String
toString()

Overrides tools.jackson.core.TokenStreamContext.toString.

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

public final void
valueStarted()

Method called to mark start of new value, mostly to update `index` for Array and Root contexts.

Inherited from tools.jackson.core.TokenStreamContext:
getCurrentIndexgetEntryCountgetNestingDepthhasCurrentIndexhasPathSegmentinArrayinObjectinRootpathAsPointerpathAsPointertypeDesc

Field Detail

_childback to summary
protected XmlReadContext _child
_columnNrback to summary
protected int _columnNr
_currentNameback to summary
protected String _currentName
_currentValueback to summary
protected Object _currentValue
_lineNrback to summary
protected int _lineNr
_namesToWrapback to summary
protected Set<String> _namesToWrap
_parentback to summary
protected final XmlReadContext _parent
_wrappedNameback to summary
protected String _wrappedName

Name of property that requires wrapping

Constructor Detail

XmlReadContextback to summary
public XmlReadContext(int type, XmlReadContext parent, int nestingDepth, int lineNr, int colNr)

Method Detail

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
convertToArrayback to summary
protected void convertToArray()
createChildArrayContextback to summary
public final XmlReadContext createChildArrayContext(int lineNr, int colNr)
createChildObjectContextback to summary
public final XmlReadContext createChildObjectContext(int lineNr, int colNr)
createRootContextback to summary
public static XmlReadContext createRootContext(int lineNr, int colNr)
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 XmlReadContext 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
resetback to summary
protected final void reset(int type, int lineNr, int colNr)
setCurrentNameback to summary
public void setCurrentName(String name)
setNamesToWrapback to summary
public void setNamesToWrap(Set<String> namesToWrap)
shouldWrapback to summary
public boolean shouldWrap(String localName)
startLocationback to summary
public final TokenStreamLocation startLocation(ContentReference srcRef)

Overrides tools.jackson.core.TokenStreamContext.startLocation.

Doc from tools.jackson.core.TokenStreamContext.startLocation.

Optional method that may be used to access starting location of this context: for example, in case of JSON `Object` context, offset at which `[` token was read or written. Often used for error reporting purposes. Implementations that do not keep track of such location are expected to return TokenStreamLocation#NA; this is what the default implementation does.

Returns:TokenStreamLocation

Location pointing to the point where the context start marker was found

Annotations
@Override
toStringback to summary
public final String toString()

Overrides tools.jackson.core.TokenStreamContext.toString.

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

Annotations
@Override
valueStartedback to summary
public final void valueStarted()

Method called to mark start of new value, mostly to update `index` for Array and Root contexts.

Since
2.12