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.JsonStreamContextExtension ofJsonStreamContext, 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
Fields Modifier and Type Field Description protected XmlReadContext_childprotected int_columnNrprotected java.lang.String_currentNameprotected java.lang.Object_currentValueprotected int_lineNrprotected java.util.Set<java.lang.String>_namesToWrapprotected XmlReadContext_parentprotected java.lang.String_wrappedNameName of property that requires wrapping
-
Constructor Summary
Constructors Constructor Description XmlReadContext(XmlReadContext parent, int type, int lineNr, int colNr)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconvertToArray()XmlReadContextcreateChildArrayContext(int lineNr, int colNr)XmlReadContextcreateChildObjectContext(int lineNr, int colNr)static XmlReadContextcreateRootContext()static XmlReadContextcreateRootContext(int lineNr, int colNr)java.lang.StringgetCurrentName()java.lang.ObjectgetCurrentValue()XmlReadContextgetParent()booleanhasCurrentName()protected voidreset(int type, int lineNr, int colNr)voidsetCurrentName(java.lang.String name)voidsetCurrentValue(java.lang.Object v)voidsetNamesToWrap(java.util.Set<java.lang.String> namesToWrap)booleanshouldWrap(java.lang.String localName)com.fasterxml.jackson.core.JsonLocationstartLocation(com.fasterxml.jackson.core.io.ContentReference srcRef)java.lang.StringtoString()Overridden to provide developer readable "JsonPath" representation of the context.voidvalueStarted()Method called to mark start of new value, mostly to update `index` for Array and Root contexts.
-
-
-
Field Detail
-
_parent
protected final XmlReadContext _parent
-
_lineNr
protected int _lineNr
-
_columnNr
protected int _columnNr
-
_currentName
protected java.lang.String _currentName
-
_currentValue
protected java.lang.Object _currentValue
- Since:
- 2.9
-
_namesToWrap
protected java.util.Set<java.lang.String> _namesToWrap
-
_wrappedName
protected java.lang.String _wrappedName
Name of property that requires wrapping
-
_child
protected XmlReadContext _child
-
-
Constructor Detail
-
XmlReadContext
public XmlReadContext(XmlReadContext parent, int type, int lineNr, int colNr)
-
-
Method Detail
-
reset
protected final void reset(int type, int lineNr, int colNr)
-
getCurrentValue
public java.lang.Object getCurrentValue()
- Overrides:
getCurrentValuein classcom.fasterxml.jackson.core.JsonStreamContext
-
setCurrentValue
public void setCurrentValue(java.lang.Object v)
- Overrides:
setCurrentValuein classcom.fasterxml.jackson.core.JsonStreamContext
-
createRootContext
public static XmlReadContext createRootContext(int lineNr, int colNr)
-
createRootContext
public static XmlReadContext createRootContext()
-
createChildArrayContext
public final XmlReadContext createChildArrayContext(int lineNr, int colNr)
-
createChildObjectContext
public final XmlReadContext createChildObjectContext(int lineNr, int colNr)
-
getCurrentName
public final java.lang.String getCurrentName()
- Specified by:
getCurrentNamein classcom.fasterxml.jackson.core.JsonStreamContext
-
hasCurrentName
public boolean hasCurrentName()
- Overrides:
hasCurrentNamein classcom.fasterxml.jackson.core.JsonStreamContext
-
getParent
public final XmlReadContext 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
public void setCurrentName(java.lang.String name)
-
setNamesToWrap
public void setNamesToWrap(java.util.Set<java.lang.String> namesToWrap)
-
shouldWrap
public boolean shouldWrap(java.lang.String localName)
-
convertToArray
protected void convertToArray()
-
toString
public final java.lang.String toString()
Overridden to provide developer readable "JsonPath" representation of the context.- Overrides:
toStringin classcom.fasterxml.jackson.core.JsonStreamContext
-
-