Class XmlReadContext
java.lang.Object
com.fasterxml.jackson.core.JsonStreamContext
com.fasterxml.jackson.dataformat.xml.deser.XmlReadContext
public final class XmlReadContext
extends com.fasterxml.jackson.core.JsonStreamContext
Extension of
JsonStreamContext, 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
FieldsModifier and TypeFieldDescriptionprotected XmlReadContextprotected intprotected Stringprotected Objectprotected intprotected final XmlReadContextprotected StringName of property that requires wrappingFields inherited from class com.fasterxml.jackson.core.JsonStreamContext
_index, _nestingDepth, _type, TYPE_ARRAY, TYPE_OBJECT, TYPE_ROOT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfinal XmlReadContextcreateChildArrayContext(int lineNr, int colNr) final XmlReadContextcreateChildObjectContext(int lineNr, int colNr) static XmlReadContextstatic XmlReadContextcreateRootContext(int lineNr, int colNr) final Stringfinal XmlReadContextbooleanprotected final voidreset(int type, int lineNr, int colNr) voidsetCurrentName(String name) voidvoidsetNamesToWrap(Set<String> namesToWrap) booleanshouldWrap(String localName) final com.fasterxml.jackson.core.JsonLocationstartLocation(com.fasterxml.jackson.core.io.ContentReference srcRef) final StringtoString()Overridden to provide developer readable "JsonPath" representation of the context.final voidMethod called to mark start of new value, mostly to update `index` for Array and Root contexts.Methods inherited from class com.fasterxml.jackson.core.JsonStreamContext
getCurrentIndex, getEntryCount, getNestingDepth, getStartLocation, getTypeDesc, hasCurrentIndex, hasPathSegment, inArray, inObject, inRoot, pathAsPointer, pathAsPointer, typeDesc
-
Field Details
-
_parent
-
_lineNr
protected int _lineNr -
_columnNr
protected int _columnNr -
_currentName
-
_currentValue
- Since:
- 2.9
-
_namesToWrap
-
_wrappedName
Name of property that requires wrapping -
_child
-
-
Constructor Details
-
XmlReadContext
-
-
Method Details
-
reset
protected final void reset(int type, int lineNr, int colNr) -
getCurrentValue
- Overrides:
getCurrentValuein classcom.fasterxml.jackson.core.JsonStreamContext
-
setCurrentValue
- Overrides:
setCurrentValuein classcom.fasterxml.jackson.core.JsonStreamContext
-
createRootContext
-
createRootContext
-
createChildArrayContext
-
createChildObjectContext
-
getCurrentName
- Specified by:
getCurrentNamein classcom.fasterxml.jackson.core.JsonStreamContext
-
hasCurrentName
public boolean hasCurrentName()- Overrides:
hasCurrentNamein classcom.fasterxml.jackson.core.JsonStreamContext
-
getParent
- Specified by:
getParentin classcom.fasterxml.jackson.core.JsonStreamContext
-
startLocation
public final com.fasterxml.jackson.core.JsonLocation startLocation(com.fasterxml.jackson.core.io.ContentReference srcRef) - Overrides:
startLocationin classcom.fasterxml.jackson.core.JsonStreamContext- Returns:
- Location pointing to the point where the context start marker was found
-
valueStarted
public final void valueStarted()Method called to mark start of new value, mostly to update `index` for Array and Root contexts.- Since:
- 2.12
-
setCurrentName
-
setNamesToWrap
-
shouldWrap
-
convertToArray
protected void convertToArray() -
toString
Overridden to provide developer readable "JsonPath" representation of the context.- Overrides:
toStringin classcom.fasterxml.jackson.core.JsonStreamContext
-