public final class CBORWriteContext
extends com.fasterxml.jackson.core.JsonStreamContext
JsonWriteContext, needed to support alternative
numeric field id for Integer-valued Maps that CBOR allows.| Modifier and Type | Field and Description |
|---|---|
protected CBORWriteContext |
_childToRecycle |
protected long |
_currentFieldId
Alternative to
_currentName used for integer/long-valued Maps. |
protected String |
_currentName
Name of the field of which value is to be written; only
used for OBJECT contexts
|
protected Object |
_currentValue |
protected com.fasterxml.jackson.core.json.DupDetector |
_dups |
protected boolean |
_gotFieldId
Marker used to indicate that we just wrote a field name (or Map name / id)
and now expect a value to write
|
protected CBORWriteContext |
_parent
Parent context for this context; null for root context.
|
| Modifier | Constructor and Description |
|---|---|
protected |
CBORWriteContext(int type,
CBORWriteContext parent,
com.fasterxml.jackson.core.json.DupDetector dups,
Object currentValue) |
| Modifier and Type | Method and Description |
|---|---|
CBORWriteContext |
clearAndGetParent()
Method that can be used to both clear the accumulated references
(specifically value set with
setCurrentValue(Object))
that should not be retained, and returns parent (as would
getParent() do). |
CBORWriteContext |
createChildArrayContext(Object currentValue) |
CBORWriteContext |
createChildObjectContext(Object currentValue) |
static CBORWriteContext |
createRootContext(com.fasterxml.jackson.core.json.DupDetector dd) |
String |
getCurrentName() |
Object |
getCurrentValue() |
com.fasterxml.jackson.core.json.DupDetector |
getDupDetector() |
CBORWriteContext |
getParent() |
boolean |
hasCurrentName() |
void |
setCurrentValue(Object v) |
CBORWriteContext |
withDupDetector(com.fasterxml.jackson.core.json.DupDetector dups) |
boolean |
writeFieldId(long fieldId) |
boolean |
writeFieldName(String name)
Method that writer is to call before it writes a field name.
|
boolean |
writeValue() |
protected final CBORWriteContext _parent
protected com.fasterxml.jackson.core.json.DupDetector _dups
protected CBORWriteContext _childToRecycle
protected String _currentName
protected Object _currentValue
protected long _currentFieldId
_currentName used for integer/long-valued Maps.protected boolean _gotFieldId
protected CBORWriteContext(int type,
CBORWriteContext parent,
com.fasterxml.jackson.core.json.DupDetector dups,
Object currentValue)
public CBORWriteContext withDupDetector(com.fasterxml.jackson.core.json.DupDetector dups)
public Object getCurrentValue()
getCurrentValue in class com.fasterxml.jackson.core.JsonStreamContextpublic void setCurrentValue(Object v)
setCurrentValue in class com.fasterxml.jackson.core.JsonStreamContextpublic static CBORWriteContext createRootContext(com.fasterxml.jackson.core.json.DupDetector dd)
public CBORWriteContext createChildArrayContext(Object currentValue)
public CBORWriteContext createChildObjectContext(Object currentValue)
public final CBORWriteContext getParent()
getParent in class com.fasterxml.jackson.core.JsonStreamContextpublic final String getCurrentName()
getCurrentName in class com.fasterxml.jackson.core.JsonStreamContextpublic boolean hasCurrentName()
hasCurrentName in class com.fasterxml.jackson.core.JsonStreamContextpublic CBORWriteContext clearAndGetParent()
setCurrentValue(Object))
that should not be retained, and returns parent (as would
getParent() do). Typically called when closing the active
context when encountering JsonToken.END_ARRAY or
JsonToken.END_OBJECT.public com.fasterxml.jackson.core.json.DupDetector getDupDetector()
public boolean writeFieldName(String name) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic boolean writeFieldId(long fieldId)
throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic boolean writeValue()
Copyright © 2022 FasterXML. All rights reserved.