Class TokenFilterContext
java.lang.Object
edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.core.JsonStreamContext
edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.core.filter.TokenFilterContext
Alternative variant of
JsonStreamContext
, used when filtering
content being read or written (based on TokenFilter
).- Since:
- 2.6
-
Field Summary
Modifier and TypeFieldDescriptionprotected TokenFilterContext
protected String
Name of the field of which value is to be parsed; only used for OBJECT contextsprotected TokenFilter
Filter to use for items in this state (for properties of Objects, elements of Arrays, and root-level values of root context)protected boolean
Flag that indicates that the current name of this context still needs to be read/written, if path from root down to included leaf is to be exposed.protected final TokenFilterContext
Parent context for this context; null for root context.protected boolean
Flag that indicates that start token has been read/written, so that matching close token needs to be read/written as well when context is getting closed.Fields inherited from class edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.core.JsonStreamContext
_index, _type, TYPE_ARRAY, TYPE_OBJECT, TYPE_ROOT
-
Constructor Summary
ModifierConstructorDescriptionprotected
TokenFilterContext
(int type, TokenFilterContext parent, TokenFilter filter, boolean startHandled) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
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.closeArray
(JsonGenerator gen) closeObject
(JsonGenerator gen) createChildArrayContext
(TokenFilter filter, boolean writeStart) createChildObjectContext
(TokenFilter filter, boolean writeStart) static TokenFilterContext
createRootContext
(TokenFilter filter) void
Method called to ensure that field name, if present, has been written; may result (but does not always) in a call using given generatorfindChildOf
(TokenFilterContext parent) final String
Method for accessing name associated with the current location.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.final TokenFilterContext
Accessor for finding parent context of this context; will return null for root context.boolean
boolean
protected TokenFilterContext
reset
(int type, TokenFilter filter, boolean startWritten) void
Method to call to pass value to be returned viaJsonStreamContext.getCurrentValue()
; typically called indirectly throughJsonParser.setCurrentValue(java.lang.Object)
orJsonGenerator.setCurrentValue(java.lang.Object)
).setFieldName
(String name) void
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.Methods inherited from class edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.core.JsonStreamContext
getCurrentIndex, getEntryCount, getStartLocation, getTypeDesc, hasCurrentIndex, hasPathSegment, inArray, inObject, inRoot, pathAsPointer, pathAsPointer, startLocation, typeDesc
-
Field Details
-
_parent
Parent context for this context; null for root context. -
_child
-
_currentName
Name of the field of which value is to be parsed; only used for OBJECT contexts -
_filter
Filter to use for items in this state (for properties of Objects, elements of Arrays, and root-level values of root context) -
_startHandled
protected boolean _startHandledFlag that indicates that start token has been read/written, so that matching close token needs to be read/written as well when context is getting closed. -
_needToHandleName
protected boolean _needToHandleNameFlag that indicates that the current name of this context still needs to be read/written, if path from root down to included leaf is to be exposed.
-
-
Constructor Details
-
TokenFilterContext
protected TokenFilterContext(int type, TokenFilterContext parent, TokenFilter filter, boolean startHandled)
-
-
Method Details
-
reset
-
createRootContext
-
createChildArrayContext
-
createChildObjectContext
-
setFieldName
- Throws:
JsonProcessingException
-
checkValue
Method called to check whether value is to be included at current output position, either as Object property, Array element, or root value.- Parameters:
filter
- Currently active filter- Returns:
- Filter to use for value
-
ensureFieldNameWritten
Method called to ensure that field name, if present, has been written; may result (but does not always) in a call using given generator- Parameters:
gen
- Generator to use to write the property name, if necessary- Throws:
IOException
- If there is a problem writing property name (typically thrown byJsonGenerator
)
-
writePath
Method called to ensure that parent path from root is written up to and including this node.- Parameters:
gen
- Generator to use to write the path, if necessary- Throws:
IOException
- If there is a problem writing property name (typically thrown byJsonGenerator
)
-
closeArray
- Throws:
IOException
-
closeObject
- Throws:
IOException
-
skipParentChecks
public void skipParentChecks() -
getCurrentValue
Description copied from class:JsonStreamContext
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.Note 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.
- Overrides:
getCurrentValue
in classJsonStreamContext
- Returns:
- Currently active value, if one has been assigned.
-
setCurrentValue
Description copied from class:JsonStreamContext
Method to call to pass value to be returned viaJsonStreamContext.getCurrentValue()
; typically called indirectly throughJsonParser.setCurrentValue(java.lang.Object)
orJsonGenerator.setCurrentValue(java.lang.Object)
).- Overrides:
setCurrentValue
in classJsonStreamContext
- Parameters:
v
- Current value to assign to this context
-
getParent
Description copied from class:JsonStreamContext
Accessor for finding parent context of this context; will return null for root context.- Specified by:
getParent
in classJsonStreamContext
- Returns:
- Parent context of this context, if any;
null
for Root contexts
-
getCurrentName
Description copied from class:JsonStreamContext
Method for accessing name associated with the current location. Non-null forFIELD_NAME
and value events that directly follow field names; null for root level and array values.- Specified by:
getCurrentName
in classJsonStreamContext
- Returns:
- Current field name within context, if any;
null
if none
-
hasCurrentName
public boolean hasCurrentName()- Overrides:
hasCurrentName
in classJsonStreamContext
- Returns:
True
if a call toJsonStreamContext.getCurrentName()
would return non-null
name;false
otherwise
-
getFilter
-
isStartHandled
public boolean isStartHandled() -
nextTokenToRead
-
findChildOf
-
appendDesc
-
toString
Description copied from class:JsonStreamContext
Overridden to provide developer readable "JsonPath" representation of the context.- Overrides:
toString
in classJsonStreamContext
- Returns:
- Simple developer-readable description this context layer
(note: NOT constructed with parents, unlike
JsonStreamContext.pathAsPointer()
)
-