public class TokenFilterContext extends JsonStreamContext
JsonStreamContext, used when filtering
content being read or written (based on TokenFilter).TYPE_ARRAY, TYPE_OBJECT, TYPE_ROOT| Modifier and Type | Method and Description |
|---|---|
TokenFilter |
checkValue(TokenFilter filter)
Method called to check whether value is to be included at current output
position, either as Object property, Array element, or root value.
|
TokenFilterContext |
closeArray(JsonGenerator gen) |
TokenFilterContext |
closeObject(JsonGenerator gen) |
TokenFilterContext |
createChildArrayContext(TokenFilter filter,
boolean writeStart) |
TokenFilterContext |
createChildObjectContext(TokenFilter filter,
boolean writeStart) |
static TokenFilterContext |
createRootContext(TokenFilter filter) |
void |
ensureFieldNameWritten(JsonGenerator gen)
Method called to ensure that field name, if present, has been written;
may result (but does not always) in a call using given generator
|
TokenFilterContext |
findChildOf(TokenFilterContext parent) |
java.lang.String |
getCurrentName()
Method for accessing name associated with the current location.
|
java.lang.Object |
getCurrentValue()
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.
|
TokenFilter |
getFilter() |
TokenFilterContext |
getParent()
Accessor for finding parent context of this context; will
return null for root context.
|
boolean |
hasCurrentName() |
boolean |
isStartHandled() |
JsonToken |
nextTokenToRead() |
void |
setCurrentValue(java.lang.Object v)
Method to call to pass value to be returned via
JsonStreamContext.getCurrentValue(); typically
called indirectly through JsonParser.setCurrentValue(java.lang.Object)
or JsonGenerator.setCurrentValue(java.lang.Object)). |
TokenFilter |
setFieldName(java.lang.String name) |
void |
skipParentChecks() |
java.lang.String |
toString()
Overridden to provide developer readable "JsonPath" representation
of the context.
|
void |
writePath(JsonGenerator gen)
Method called to ensure that parent path from root is written up to
and including this node.
|
getCurrentIndex, getEntryCount, getStartLocation, getTypeDesc, hasCurrentIndex, hasPathSegment, inArray, inObject, inRoot, pathAsPointer, pathAsPointer, startLocation, typeDescpublic static TokenFilterContext createRootContext(TokenFilter filter)
public TokenFilterContext createChildArrayContext(TokenFilter filter, boolean writeStart)
public TokenFilterContext createChildObjectContext(TokenFilter filter, boolean writeStart)
public TokenFilter setFieldName(java.lang.String name) throws JsonProcessingException
JsonProcessingExceptionpublic TokenFilter checkValue(TokenFilter filter)
filter - Currently active filterpublic void ensureFieldNameWritten(JsonGenerator gen) throws java.io.IOException
gen - Generator to use to write the property name, if necessaryjava.io.IOException - If there is a problem writing property name (typically
thrown by JsonGenerator)public void writePath(JsonGenerator gen) throws java.io.IOException
gen - Generator to use to write the path, if necessaryjava.io.IOException - If there is a problem writing property name (typically
thrown by JsonGenerator)public TokenFilterContext closeArray(JsonGenerator gen) throws java.io.IOException
java.io.IOExceptionpublic TokenFilterContext closeObject(JsonGenerator gen) throws java.io.IOException
java.io.IOExceptionpublic void skipParentChecks()
public java.lang.Object getCurrentValue()
JsonStreamContextNote 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.
getCurrentValue in class JsonStreamContextpublic void setCurrentValue(java.lang.Object v)
JsonStreamContextJsonStreamContext.getCurrentValue(); typically
called indirectly through JsonParser.setCurrentValue(java.lang.Object)
or JsonGenerator.setCurrentValue(java.lang.Object)).setCurrentValue in class JsonStreamContextv - Current value to assign to this contextpublic final TokenFilterContext getParent()
JsonStreamContextgetParent in class JsonStreamContextnull for Root contextspublic final java.lang.String getCurrentName()
JsonStreamContextFIELD_NAME and value events that directly
follow field names; null for root level and array values.getCurrentName in class JsonStreamContextnull if nonepublic boolean hasCurrentName()
hasCurrentName in class JsonStreamContextTrue if a call to JsonStreamContext.getCurrentName() would return non-null
name; false otherwisepublic TokenFilter getFilter()
public boolean isStartHandled()
public JsonToken nextTokenToRead()
public TokenFilterContext findChildOf(TokenFilterContext parent)
public java.lang.String toString()
JsonStreamContexttoString in class JsonStreamContextJsonStreamContext.pathAsPointer())Copyright © 2010 - 2023 Adobe. All Rights Reserved