Class SimpleTokenWriteContext
- java.lang.Object
-
- com.fasterxml.jackson.core.JsonStreamContext
-
- com.fasterxml.jackson.dataformat.csv.impl.SimpleTokenWriteContext
-
public final class SimpleTokenWriteContext extends com.fasterxml.jackson.core.JsonStreamContext
Intermediate base context; for 2.x copied within CSV format codebase, in 3.0 will be part ofjackson-core
- Since:
- 2.11
-
-
Field Summary
Fields Modifier and Type Field Description protected SimpleTokenWriteContext
_childToRecycle
protected java.lang.String
_currentName
Name of the field of which value is to be written; only used for OBJECT contextsprotected java.lang.Object
_currentValue
protected com.fasterxml.jackson.core.json.DupDetector
_dups
protected boolean
_gotFieldId
Marker used to indicate that we just wrote a field name and now expect a value to writeprotected SimpleTokenWriteContext
_parent
Parent context for this context; null for root context.
-
Constructor Summary
Constructors Modifier Constructor Description protected
SimpleTokenWriteContext(int type, SimpleTokenWriteContext parent, com.fasterxml.jackson.core.json.DupDetector dups, java.lang.Object currentValue)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_checkDup(com.fasterxml.jackson.core.json.DupDetector dd, java.lang.String name)
SimpleTokenWriteContext
clearAndGetParent()
Method that can be used to both clear the accumulated references (specifically value set withsetCurrentValue(Object)
) that should not be retained, and returns parent (as wouldgetParent()
do).SimpleTokenWriteContext
createChildArrayContext(java.lang.Object currentValue)
SimpleTokenWriteContext
createChildObjectContext(java.lang.Object currentValue)
static SimpleTokenWriteContext
createRootContext(com.fasterxml.jackson.core.json.DupDetector dd)
java.lang.String
getCurrentName()
java.lang.Object
getCurrentValue()
com.fasterxml.jackson.core.json.DupDetector
getDupDetector()
SimpleTokenWriteContext
getParent()
boolean
hasCurrentName()
private SimpleTokenWriteContext
reset(int type, java.lang.Object currentValue)
void
setCurrentValue(java.lang.Object v)
SimpleTokenWriteContext
withDupDetector(com.fasterxml.jackson.core.json.DupDetector dups)
boolean
writeFieldName(java.lang.String name)
Method that writer is to call before it writes a field name.boolean
writeValue()
-
-
-
Field Detail
-
_parent
protected final SimpleTokenWriteContext _parent
Parent context for this context; null for root context.
-
_dups
protected com.fasterxml.jackson.core.json.DupDetector _dups
-
_childToRecycle
protected SimpleTokenWriteContext _childToRecycle
-
_currentName
protected java.lang.String _currentName
Name of the field of which value is to be written; only used for OBJECT contexts
-
_currentValue
protected java.lang.Object _currentValue
-
_gotFieldId
protected boolean _gotFieldId
Marker used to indicate that we just wrote a field name and now expect a value to write
-
-
Constructor Detail
-
SimpleTokenWriteContext
protected SimpleTokenWriteContext(int type, SimpleTokenWriteContext parent, com.fasterxml.jackson.core.json.DupDetector dups, java.lang.Object currentValue)
-
-
Method Detail
-
reset
private SimpleTokenWriteContext reset(int type, java.lang.Object currentValue)
-
withDupDetector
public SimpleTokenWriteContext withDupDetector(com.fasterxml.jackson.core.json.DupDetector dups)
-
getCurrentValue
public java.lang.Object getCurrentValue()
- Overrides:
getCurrentValue
in classcom.fasterxml.jackson.core.JsonStreamContext
-
setCurrentValue
public void setCurrentValue(java.lang.Object v)
- Overrides:
setCurrentValue
in classcom.fasterxml.jackson.core.JsonStreamContext
-
createRootContext
public static SimpleTokenWriteContext createRootContext(com.fasterxml.jackson.core.json.DupDetector dd)
-
createChildArrayContext
public SimpleTokenWriteContext createChildArrayContext(java.lang.Object currentValue)
-
createChildObjectContext
public SimpleTokenWriteContext createChildObjectContext(java.lang.Object currentValue)
-
getParent
public final SimpleTokenWriteContext getParent()
- Specified by:
getParent
in classcom.fasterxml.jackson.core.JsonStreamContext
-
getCurrentName
public final java.lang.String getCurrentName()
- Specified by:
getCurrentName
in classcom.fasterxml.jackson.core.JsonStreamContext
-
hasCurrentName
public boolean hasCurrentName()
- Overrides:
hasCurrentName
in classcom.fasterxml.jackson.core.JsonStreamContext
-
clearAndGetParent
public SimpleTokenWriteContext clearAndGetParent()
Method that can be used to both clear the accumulated references (specifically value set withsetCurrentValue(Object)
) that should not be retained, and returns parent (as wouldgetParent()
do). Typically called when closing the active context when encounteringJsonToken.END_ARRAY
orJsonToken.END_OBJECT
.
-
getDupDetector
public com.fasterxml.jackson.core.json.DupDetector getDupDetector()
-
writeFieldName
public boolean writeFieldName(java.lang.String name) throws com.fasterxml.jackson.core.JsonProcessingException
Method that writer is to call before it writes a field name.- Returns:
- Ok if name writing should proceed
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
_checkDup
private final void _checkDup(com.fasterxml.jackson.core.json.DupDetector dd, java.lang.String name) throws com.fasterxml.jackson.core.JsonProcessingException
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
writeValue
public boolean writeValue()
-
-