Class 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 Detail

      • _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
    • 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:
        getCurrentValue in class com.fasterxml.jackson.core.JsonStreamContext
      • setCurrentValue

        public void setCurrentValue​(java.lang.Object v)
        Overrides:
        setCurrentValue in class com.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:
        getCurrentName in class com.fasterxml.jackson.core.JsonStreamContext
      • hasCurrentName

        public boolean hasCurrentName()
        Overrides:
        hasCurrentName in class com.fasterxml.jackson.core.JsonStreamContext
      • getParent

        public final XmlReadContext getParent()
        Specified by:
        getParent in class com.fasterxml.jackson.core.JsonStreamContext
      • expectComma

        public final boolean expectComma()
      • setCurrentName

        public void setCurrentName​(java.lang.String name)
      • getStartLocation

        public final com.fasterxml.jackson.core.JsonLocation getStartLocation​(java.lang.Object srcRef)
        Overrides:
        getStartLocation in class com.fasterxml.jackson.core.JsonStreamContext
        Returns:
        Location pointing to the point where the context start marker was found
      • setNamesToWrap

        public void setNamesToWrap​(java.util.Set<java.lang.String> namesToWrap)
      • getNamesToWrap

        public java.util.Set<java.lang.String> getNamesToWrap()
      • convertToArray

        protected void convertToArray()
      • toString

        public final java.lang.String toString()
        Overridden to provide developer readable "JsonPath" representation of the context.
        Overrides:
        toString in class com.fasterxml.jackson.core.JsonStreamContext