java.lang.Object
tools.jackson.core.TokenStreamContext
tools.jackson.dataformat.xml.deser.XmlReadContext

public final class XmlReadContext extends tools.jackson.core.TokenStreamContext
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 Details

    • _parent

      protected final XmlReadContext _parent
    • _lineNr

      protected int _lineNr
    • _columnNr

      protected int _columnNr
    • _currentName

      protected String _currentName
    • _currentValue

      protected Object _currentValue
    • _namesToWrap

      protected Set<String> _namesToWrap
    • _wrappedName

      protected String _wrappedName
      Name of property that requires wrapping
    • _child

      protected XmlReadContext _child
  • Constructor Details

    • XmlReadContext

      public XmlReadContext(int type, XmlReadContext parent, int nestingDepth, int lineNr, int colNr)
  • Method Details

    • reset

      protected final void reset(int type, int lineNr, int colNr)
    • currentValue

      public Object currentValue()
      Overrides:
      currentValue in class tools.jackson.core.TokenStreamContext
    • assignCurrentValue

      public void assignCurrentValue(Object v)
      Overrides:
      assignCurrentValue in class tools.jackson.core.TokenStreamContext
    • createRootContext

      public static XmlReadContext createRootContext(int lineNr, int colNr)
    • createChildArrayContext

      public final XmlReadContext createChildArrayContext(int lineNr, int colNr)
    • createChildObjectContext

      public final XmlReadContext createChildObjectContext(int lineNr, int colNr)
    • currentName

      public final String currentName()
      Specified by:
      currentName in class tools.jackson.core.TokenStreamContext
    • hasCurrentName

      public boolean hasCurrentName()
      Overrides:
      hasCurrentName in class tools.jackson.core.TokenStreamContext
    • getParent

      public final XmlReadContext getParent()
      Specified by:
      getParent in class tools.jackson.core.TokenStreamContext
    • startLocation

      public final tools.jackson.core.TokenStreamLocation startLocation(tools.jackson.core.io.ContentReference srcRef)
      Overrides:
      startLocation in class tools.jackson.core.TokenStreamContext
      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(String name)
    • setNamesToWrap

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

      public boolean shouldWrap(String localName)
    • convertToArray

      protected void convertToArray()
    • toString

      public final String toString()
      Overridden to provide developer readable "JsonPath" representation of the context.
      Overrides:
      toString in class tools.jackson.core.TokenStreamContext