TokenStreamContext useful for most
format backend JsonParser implementations
(with notable exception of JSON that needs bit more advanced state).
| Modifier and Type | Field and Description |
|---|---|
| protected SimpleStreamReadContext | |
| protected int | |
| protected String | |
| protected Object | |
| protected DupDetector | |
| protected int | |
| protected final SimpleStreamReadContext | _parent
Parent context for this context; null for root context. |
| Access | Constructor and Description |
|---|---|
| public | SimpleStreamReadContext(int type, SimpleStreamReadContext parent, int nestingDepth, DupDetector dups, int lineNr, int colNr)
|
| public | SimpleStreamReadContext(int type, SimpleStreamReadContext parent, DupDetector dups, int lineNr, int colNr)
Deprecated
|
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| public void | assignCurrentValue(Object v)
Overrides tools. Method to call to pass value to be returned via |
| public SimpleStreamReadContext | Returns: Parent context of this context node, if any;null for root contextMethod that can be used to both clear the accumulated references
(specifically value set with |
| public SimpleStreamReadContext | |
| public SimpleStreamReadContext | |
| public static SimpleStreamReadContext | |
| public static SimpleStreamReadContext | |
| public String | currentName()
Implements abstract tools. Method for accessing name associated with the current location. |
| public Object | currentValue()
Overrides tools. Method for accessing currently active value being used by data-binding (as the source of streaming data to write, or destination of data being read), at this level in hierarchy. |
| public DupDetector | |
| public SimpleStreamReadContext | getParent()
Implements abstract tools. Accessor for finding parent context of this context; will return null for root context. |
| public boolean | |
| protected void | |
| public void | setCurrentName(String
Name of Object property encountered name)Method called to indicate what the "current" name (Object property name just decoded) is: may also trigger duplicate detection. |
| public TokenStreamLocation | startLocation(ContentReference srcRef)
Overrides tools. Optional method that may be used to access starting location of this context: for example, in case of JSON `Object` context, offset at which `[` token was read or written. |
| public int | Returns: Index after incrementMethod to call to advance index within current context: to be called when a new token found within current context (property name for objects, value for root and array contexts) |
| _childToRecycle | back to summary |
|---|---|
| protected SimpleStreamReadContext _childToRecycle | |
| _columnNr | back to summary |
|---|---|
| protected int _columnNr | |
| _currentName | back to summary |
|---|---|
| protected String _currentName | |
| _currentValue | back to summary |
|---|---|
| protected Object _currentValue | |
| _dups | back to summary |
|---|---|
| protected DupDetector _dups | |
| _lineNr | back to summary |
|---|---|
| protected int _lineNr | |
| _parent | back to summary |
|---|---|
| protected final SimpleStreamReadContext _parent Parent context for this context; null for root context. | |
| SimpleStreamReadContext | back to summary |
|---|---|
| public SimpleStreamReadContext(int type, SimpleStreamReadContext parent, int nestingDepth, DupDetector dups, int lineNr, int colNr) | |
| SimpleStreamReadContext | back to summary |
|---|---|
| public SimpleStreamReadContext(int type, SimpleStreamReadContext parent, DupDetector dups, int lineNr, int colNr)
Deprecated
| |
| _checkDup | back to summary |
|---|---|
| protected void _checkDup(DupDetector dd, String name) throws StreamReadException | |
| assignCurrentValue | back to summary |
|---|---|
| public void assignCurrentValue(Object v) Overrides tools. Doc from tools. Method to call to pass value to be returned via
| |
| clearAndGetParent | back to summary |
|---|---|
| public SimpleStreamReadContext clearAndGetParent() Method that can be used to both clear the accumulated references
(specifically value set with
| |
| createChildArrayContext | back to summary |
|---|---|
| public SimpleStreamReadContext createChildArrayContext(int lineNr, int colNr) | |
| createChildObjectContext | back to summary |
|---|---|
| public SimpleStreamReadContext createChildObjectContext(int lineNr, int colNr) | |
| createRootContext | back to summary |
|---|---|
| public static SimpleStreamReadContext createRootContext(int lineNr, int colNr, DupDetector dups) | |
| createRootContext | back to summary |
|---|---|
| public static SimpleStreamReadContext createRootContext(DupDetector dups) | |
| currentName | back to summary |
|---|---|
| public String currentName() Implements abstract tools. Doc from tools. Method for accessing name associated with the current location.
Non-null for
| |
| currentValue | back to summary |
|---|---|
| public Object currentValue() Overrides tools. Doc from tools. Method for accessing currently active value being used by data-binding (as the source of streaming data to write, or destination of data being read), at this level in hierarchy. Note that "current value" is NOT populated (or used) by Streaming parser or generator; it is only used by higher-level data-binding functionality. The reason it is included here is that it can be stored and accessed hierarchically, and gets passed through data-binding.
| |
| getDupDetector | back to summary |
|---|---|
| public DupDetector getDupDetector() | |
| getParent | back to summary |
|---|---|
| public SimpleStreamReadContext getParent() Implements abstract tools. Doc from tools. Accessor for finding parent context of this context; will return null for root context.
| |
| hasCurrentName | back to summary |
|---|---|
| public boolean hasCurrentName() Overrides tools.
| |
| reset | back to summary |
|---|---|
| protected void reset(int type, int lineNr, int colNr) | |
| setCurrentName | back to summary |
|---|---|
| public void setCurrentName(String name) throws StreamReadException Method called to indicate what the "current" name (Object property name just decoded) is: may also trigger duplicate detection.
| |
| startLocation | back to summary |
|---|---|
| public TokenStreamLocation startLocation(ContentReference srcRef) Overrides tools. Doc from tools. Optional method that may be used to access starting location of this context:
for example, in case of JSON `Object` context, offset at which `[` token was
read or written. Often used for error reporting purposes.
Implementations that do not keep track of such location are expected to return
| |
| valueRead | back to summary |
|---|---|
| public int valueRead() Method to call to advance index within current context: to be called when a new token found within current context (property name for objects, value for root and array contexts)
| |