public final class SmileWriteContext
extends com.fasterxml.jackson.core.JsonStreamContext
JsonWriteContext
; while not strictly
needed is more streamlined, optimal since there's no need to
keep track of separators etc.Modifier and Type | Field and Description |
---|---|
protected SmileWriteContext |
_childToRecycle |
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 SmileWriteContext |
_parent
Parent context for this context; null for root context.
|
Modifier | Constructor and Description |
---|---|
protected |
SmileWriteContext(int type,
SmileWriteContext parent,
com.fasterxml.jackson.core.json.DupDetector dups,
Object currentValue) |
Modifier and Type | Method and Description |
---|---|
SmileWriteContext |
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). |
SmileWriteContext |
createChildArrayContext(Object currentValue) |
SmileWriteContext |
createChildObjectContext(Object currentValue) |
static SmileWriteContext |
createRootContext(com.fasterxml.jackson.core.json.DupDetector dd) |
String |
getCurrentName() |
Object |
getCurrentValue() |
com.fasterxml.jackson.core.json.DupDetector |
getDupDetector() |
SmileWriteContext |
getParent() |
boolean |
hasCurrentName() |
void |
setCurrentValue(Object v) |
SmileWriteContext |
withDupDetector(com.fasterxml.jackson.core.json.DupDetector dups) |
boolean |
writeFieldName(String name)
Method that writer is to call before it writes a field name.
|
boolean |
writeValue() |
protected final SmileWriteContext _parent
protected com.fasterxml.jackson.core.json.DupDetector _dups
protected SmileWriteContext _childToRecycle
protected String _currentName
protected Object _currentValue
protected boolean _gotFieldId
protected SmileWriteContext(int type, SmileWriteContext parent, com.fasterxml.jackson.core.json.DupDetector dups, Object currentValue)
public SmileWriteContext withDupDetector(com.fasterxml.jackson.core.json.DupDetector dups)
public Object getCurrentValue()
getCurrentValue
in class com.fasterxml.jackson.core.JsonStreamContext
public void setCurrentValue(Object v)
setCurrentValue
in class com.fasterxml.jackson.core.JsonStreamContext
public static SmileWriteContext createRootContext(com.fasterxml.jackson.core.json.DupDetector dd)
public SmileWriteContext createChildArrayContext(Object currentValue)
public SmileWriteContext createChildObjectContext(Object currentValue)
public final SmileWriteContext getParent()
getParent
in class com.fasterxml.jackson.core.JsonStreamContext
public final String getCurrentName()
getCurrentName
in class com.fasterxml.jackson.core.JsonStreamContext
public boolean hasCurrentName()
hasCurrentName
in class com.fasterxml.jackson.core.JsonStreamContext
public SmileWriteContext 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.JsonProcessingException
public boolean writeValue()
Copyright © 2019 FasterXML. All rights reserved.