public class TokenFilterContext extends JsonStreamContext
JsonStreamContext, used when filtering
content being read or written (based on TokenFilter).| 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) |
TokenFilterContext |
findChildOf(TokenFilterContext parent) |
String |
getCurrentName()
Method for accessing name associated with the current location.
|
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(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(String name) |
void |
skipParentChecks() |
String |
toString()
Overridden to provide developer writeable "JsonPath" representation
of the context.
|
void |
writeImmediatePath(JsonGenerator gen)
Variant of
writePath(JsonGenerator) called when all we
need is immediately surrounding Object. |
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, typeDescpublic static TokenFilterContext createRootContext(TokenFilter filter)
public TokenFilterContext createChildArrayContext(TokenFilter filter, boolean writeStart)
public TokenFilterContext createChildObjectContext(TokenFilter filter, boolean writeStart)
public TokenFilter setFieldName(String name) throws JsonProcessingException
JsonProcessingExceptionpublic TokenFilter checkValue(TokenFilter filter)
public void writePath(JsonGenerator gen) throws IOException
IOExceptionpublic void writeImmediatePath(JsonGenerator gen) throws IOException
writePath(JsonGenerator) called when all we
need is immediately surrounding Object. Method typically called
when including a single property but not including full path
to root.IOExceptionpublic TokenFilterContext closeArray(JsonGenerator gen) throws IOException
IOExceptionpublic TokenFilterContext closeObject(JsonGenerator gen) throws IOException
IOExceptionpublic void skipParentChecks()
public 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(Object v)
JsonStreamContextJsonStreamContext.getCurrentValue(); typically
called indirectly through JsonParser.setCurrentValue(java.lang.Object)
or JsonGenerator.setCurrentValue(java.lang.Object)).setCurrentValue in class JsonStreamContextpublic final TokenFilterContext getParent()
JsonStreamContextgetParent in class JsonStreamContextpublic final String getCurrentName()
JsonStreamContextFIELD_NAME and value events that directly
follow field names; null for root level and array values.getCurrentName in class JsonStreamContextpublic boolean hasCurrentName()
hasCurrentName in class JsonStreamContextpublic TokenFilter getFilter()
public boolean isStartHandled()
public JsonToken nextTokenToRead()
public TokenFilterContext findChildOf(TokenFilterContext parent)
public String toString()
toString in class JsonStreamContextCopyright © 2010 - 2020 Adobe. All Rights Reserved