com.fasterxml.jackson.dataformat.xml.deser

## 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

Fields
`protected XmlReadContext` `_child`
`protected int` `_columnNr`
`protected String` `_currentName`
`protected Object` `_currentValue`
`protected int` `_lineNr`
`protected Set<String>` `_namesToWrap`
`protected XmlReadContext` `_parent`
`protected String` `_wrappedName` Name of property that requires wrapping

### Fields inherited from class com.fasterxml.jackson.core.JsonStreamContext

`_index, _type, TYPE_ARRAY, TYPE_OBJECT, TYPE_ROOT`

### Constructor Summary

Constructors
Constructor and Description
`XmlReadContext(XmlReadContext parent, int type, int lineNr, int colNr)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`protected void` `convertToArray()`
`XmlReadContext` `createChildArrayContext(int lineNr, int colNr)`
`XmlReadContext` `createChildObjectContext(int lineNr, int colNr)`
`static XmlReadContext` `createRootContext()`
`static XmlReadContext` `createRootContext(int lineNr, int colNr)`
`boolean` `expectComma()`
`String` `getCurrentName()`
`Object` `getCurrentValue()`
`Set<String>` `getNamesToWrap()`
`XmlReadContext` `getParent()`
`com.fasterxml.jackson.core.JsonLocation` `getStartLocation(Object srcRef)`
`boolean` `hasCurrentName()`
`protected void` `reset(int type, int lineNr, int colNr)`
`void` `setCurrentName(String name)`
`void` `setCurrentValue(Object v)`
`void` `setNamesToWrap(Set<String> namesToWrap)`
`String` `toString()` Overridden to provide developer readable "JsonPath" representation of the context.

### Methods inherited from class com.fasterxml.jackson.core.JsonStreamContext

`getCurrentIndex, getEntryCount, getTypeDesc, hasCurrentIndex, hasPathSegment, inArray, inObject, inRoot, pathAsPointer, pathAsPointer, typeDesc`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### _parent

    protected final XmlReadContext _parent

#### _lineNr

    protected int _lineNr

#### _columnNr

    protected int _columnNr

#### _currentName

    protected String _currentName

#### _currentValue

    protected Object _currentValue

Since:
  2.9

#### _namesToWrap

    protected Set<String> _namesToWrap

#### _wrappedName

    protected 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 Object getCurrentValue()

Overrides:
  `getCurrentValue` in class `com.fasterxml.jackson.core.JsonStreamContext`

#### setCurrentValue

    public void setCurrentValue(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 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(String name)

#### getStartLocation

    public final com.fasterxml.jackson.core.JsonLocation getStartLocation(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(Set<String> namesToWrap)

#### getNamesToWrap

    public Set<String> getNamesToWrap()

#### convertToArray

    protected void convertToArray()

#### toString

    public final String toString()

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

Overrides:
  `toString` in class `com.fasterxml.jackson.core.JsonStreamContext`