Class ContainerNode<T extends ContainerNode<T>>
java.lang.Object
edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.JsonSerializable.Base
edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.JsonNode
edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.node.BaseJsonNode
edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.node.ContainerNode<T>
- All Implemented Interfaces:
TreeNode
,JsonSerializable
,JsonNodeCreator
,Serializable
,Iterable<JsonNode>
- Direct Known Subclasses:
ArrayNode
,ObjectNode
public abstract class ContainerNode<T extends ContainerNode<T>>
extends BaseJsonNode
implements JsonNodeCreator
This intermediate base class is used for all container nodes,
specifically, array and object nodes.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.JsonNode
JsonNode.OverwriteMode
Nested classes/interfaces inherited from interface edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.JsonSerializable
JsonSerializable.Base
-
Field Summary
Modifier and TypeFieldDescriptionprotected final JsonNodeFactory
We will keep a reference to the Object (usually TreeMapper) that can construct instances of nodes to add to this container node. -
Constructor Summary
ModifierConstructorDescriptionprotected
protected
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ObjectNode
_withObject
(JsonPointer origPtr, JsonPointer currentPtr, JsonNode.OverwriteMode overwriteMode, boolean preferIndex) final ArrayNode
Factory method that constructs and returns an emptyArrayNode
Construction is done using registeredJsonNodeFactory
.final ArrayNode
arrayNode
(int capacity) Factory method that constructs and returns anArrayNode
with an initial capacity Construction is done using registeredJsonNodeFactory
asText()
Method that will return a valid String representation of the container value, if the node is a value node (methodJsonNode.isValueNode()
returns true), otherwise empty String.abstract JsonToken
asToken()
Method that can be used for efficient type detection when using stream abstraction for traversing nodes.final BinaryNode
binaryNode
(byte[] data) final BinaryNode
binaryNode
(byte[] data, int offset, int length) final BooleanNode
booleanNode
(boolean v) abstract JsonNode
get
(int index) Method for accessing value of the specified element of an array node.abstract JsonNode
Method for accessing value of the specified field of an object node.final NullNode
nullNode()
final NumericNode
numberNode
(byte v) final NumericNode
numberNode
(double v) final NumericNode
numberNode
(float v) final NumericNode
numberNode
(int v) final NumericNode
numberNode
(long v) final NumericNode
numberNode
(short v) final ValueNode
numberNode
(Byte v) final ValueNode
numberNode
(Double v) final ValueNode
numberNode
(Float v) final ValueNode
final ValueNode
numberNode
(Long v) final ValueNode
numberNode
(Short v) final ValueNode
final ValueNode
final ObjectNode
Factory method that constructs and returns an emptyObjectNode
Construction is done using registeredJsonNodeFactory
.final ValueNode
final ValueNode
rawValueNode
(RawValue value) Factory method to use for adding "raw values"; pre-encoded values that are included exactly as-is when node is serialized.abstract T
Method for removing all children container has (if any)abstract int
size()
Method that returns number of child nodes this node contains: for Array nodes, number of child elements, for Object nodes, number of fields, and for all other nodes 0.final TextNode
Methods inherited from class edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.node.BaseJsonNode
_jsonPointerIfValid, _reportWrongNodeOperation, _reportWrongNodeType, _withArray, _withXxxMayReplace, _withXxxVerifyReplace, findPath, hashCode, numberType, required, required, serialize, serializeWithType, toPrettyString, toString, traverse, traverse, withArray, withObject
Methods inherited from class edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.JsonNode
_at, _reportRequiredViolation, _this, asBoolean, asBoolean, asDouble, asDouble, asInt, asInt, asLong, asLong, asText, at, at, bigIntegerValue, binaryValue, booleanValue, canConvertToExactIntegral, canConvertToInt, canConvertToLong, decimalValue, deepCopy, doubleValue, elements, equals, equals, fieldNames, fields, findParent, findParents, findParents, findValue, findValues, findValues, findValuesAsText, findValuesAsText, floatValue, getNodeType, has, has, hasNonNull, hasNonNull, intValue, isArray, isBigDecimal, isBigInteger, isBinary, isBoolean, isContainerNode, isDouble, isEmpty, isFloat, isFloatingPointNumber, isInt, isIntegralNumber, isLong, isMissingNode, isNull, isNumber, isObject, isPojo, isShort, isTextual, isValueNode, iterator, longValue, numberValue, path, path, require, requiredAt, requiredAt, requireNonNull, shortValue, textValue, with, withArray, withArray, withArray, withObject, withObject, withObject
Methods inherited from class edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.JsonSerializable.Base
isEmpty
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
_nodeFactory
We will keep a reference to the Object (usually TreeMapper) that can construct instances of nodes to add to this container node.
-
-
Constructor Details
-
ContainerNode
-
ContainerNode
protected ContainerNode()
-
-
Method Details
-
asToken
Description copied from class:BaseJsonNode
Method that can be used for efficient type detection when using stream abstraction for traversing nodes. Will return the firstJsonToken
that equivalent stream event would produce (for most nodes there is just one token but for structured/container types multiple)- Specified by:
asToken
in interfaceTreeNode
- Specified by:
asToken
in classBaseJsonNode
- Returns:
JsonToken
that is most closely associated with the node type
-
asText
Description copied from class:JsonNode
Method that will return a valid String representation of the container value, if the node is a value node (methodJsonNode.isValueNode()
returns true), otherwise empty String. -
size
public abstract int size()Description copied from interface:TreeNode
Method that returns number of child nodes this node contains: for Array nodes, number of child elements, for Object nodes, number of fields, and for all other nodes 0. -
get
Description copied from class:JsonNode
Method for accessing value of the specified element of an array node. For other nodes, null is always returned.For array nodes, index specifies exact location within array and allows for efficient iteration over child elements (underlying storage is guaranteed to be efficiently indexable, i.e. has random-access to elements). If index is less than 0, or equal-or-greater than
node.size()
, null is returned; no exception is thrown for any index.NOTE: if the element value has been explicitly set as
null
(which is different from removal!), aNullNode
will be returned, not null. -
get
Description copied from class:JsonNode
Method for accessing value of the specified field of an object node. If this node is not an object (or it does not have a value for specified field name), or if there is no field with such name, null is returned.NOTE: if the property value has been explicitly set as
null
(which is different from removal!), aNullNode
will be returned, not null. -
_withObject
protected abstract ObjectNode _withObject(JsonPointer origPtr, JsonPointer currentPtr, JsonNode.OverwriteMode overwriteMode, boolean preferIndex) - Overrides:
_withObject
in classBaseJsonNode
-
booleanNode
- Specified by:
booleanNode
in interfaceJsonNodeCreator
-
missingNode
-
nullNode
- Specified by:
nullNode
in interfaceJsonNodeCreator
-
arrayNode
Factory method that constructs and returns an emptyArrayNode
Construction is done using registeredJsonNodeFactory
.- Specified by:
arrayNode
in interfaceJsonNodeCreator
-
arrayNode
Factory method that constructs and returns anArrayNode
with an initial capacity Construction is done using registeredJsonNodeFactory
- Specified by:
arrayNode
in interfaceJsonNodeCreator
- Parameters:
capacity
- the initial capacity of the ArrayNode
-
objectNode
Factory method that constructs and returns an emptyObjectNode
Construction is done using registeredJsonNodeFactory
.- Specified by:
objectNode
in interfaceJsonNodeCreator
-
numberNode
- Specified by:
numberNode
in interfaceJsonNodeCreator
-
numberNode
- Specified by:
numberNode
in interfaceJsonNodeCreator
-
numberNode
- Specified by:
numberNode
in interfaceJsonNodeCreator
-
numberNode
- Specified by:
numberNode
in interfaceJsonNodeCreator
-
numberNode
- Specified by:
numberNode
in interfaceJsonNodeCreator
-
numberNode
- Specified by:
numberNode
in interfaceJsonNodeCreator
-
numberNode
- Specified by:
numberNode
in interfaceJsonNodeCreator
-
numberNode
- Specified by:
numberNode
in interfaceJsonNodeCreator
-
numberNode
- Specified by:
numberNode
in interfaceJsonNodeCreator
-
numberNode
- Specified by:
numberNode
in interfaceJsonNodeCreator
-
numberNode
- Specified by:
numberNode
in interfaceJsonNodeCreator
-
numberNode
- Specified by:
numberNode
in interfaceJsonNodeCreator
-
numberNode
- Specified by:
numberNode
in interfaceJsonNodeCreator
-
numberNode
- Specified by:
numberNode
in interfaceJsonNodeCreator
-
textNode
- Specified by:
textNode
in interfaceJsonNodeCreator
-
binaryNode
- Specified by:
binaryNode
in interfaceJsonNodeCreator
-
binaryNode
- Specified by:
binaryNode
in interfaceJsonNodeCreator
-
pojoNode
- Specified by:
pojoNode
in interfaceJsonNodeCreator
-
rawValueNode
Description copied from interface:JsonNodeCreator
Factory method to use for adding "raw values"; pre-encoded values that are included exactly as-is when node is serialized. This may be used, for example, to include fully serialized JSON sub-trees. Note that the concept may not work with all backends, and since no translation of any kinds is done it will not work when converting between data formats.- Specified by:
rawValueNode
in interfaceJsonNodeCreator
-
removeAll
Method for removing all children container has (if any)- Returns:
- Container node itself (to allow method call chaining)
-