|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.jackson.JsonNode
org.codehaus.jackson.node.BaseJsonNode
org.codehaus.jackson.node.ContainerNode
public abstract class ContainerNode
This intermediate base class is used for all container nodes, specifically, array and object nodes.
Nested Class Summary | |
---|---|
protected static class |
ContainerNode.NoNodesIterator
|
protected static class |
ContainerNode.NoStringsIterator
|
Constructor Summary | |
---|---|
protected |
ContainerNode(JsonNodeFactory nc)
|
Method Summary | |
---|---|
ArrayNode |
arrayNode()
|
abstract JsonToken |
asToken()
Method that can be used for efficient type detection when using stream abstraction for traversing nodes. |
BinaryNode |
binaryNode(byte[] data)
|
BinaryNode |
binaryNode(byte[] data,
int offset,
int length)
|
BooleanNode |
booleanNode(boolean v)
|
abstract JsonNode |
get(int index)
Method for accessing value of the specified element of an array node. |
abstract JsonNode |
get(String fieldName)
Method for accessing value of the specified field of an object node. |
String |
getValueAsText()
Method that will return valid String representation of the container value, if the node is a value node (method JsonNode.isValueNode() returns true), otherwise null. |
boolean |
isContainerNode()
Method that returns true for container nodes: Arrays and Objects. |
NullNode |
nullNode()
|
NumericNode |
numberNode(BigDecimal v)
|
NumericNode |
numberNode(byte v)
|
NumericNode |
numberNode(double v)
|
NumericNode |
numberNode(float v)
|
NumericNode |
numberNode(int v)
|
NumericNode |
numberNode(long v)
|
NumericNode |
numberNode(short v)
|
ObjectNode |
objectNode()
|
POJONode |
POJONode(Object pojo)
|
abstract ContainerNode |
removeAll()
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. |
TextNode |
textNode(String text)
|
Methods inherited from class org.codehaus.jackson.node.BaseJsonNode |
---|
getNumberType, serialize, serializeWithType, traverse, writeTo |
Methods inherited from class org.codehaus.jackson.JsonNode |
---|
equals, getBigIntegerValue, getBinaryValue, getBooleanValue, getDecimalValue, getDoubleValue, getElements, getElementValue, getFieldNames, getFieldValue, getIntValue, getLongValue, getNumberValue, getPath, getPath, getTextValue, isArray, isBigDecimal, isBigInteger, isBinary, isBoolean, isDouble, isFloatingPointNumber, isInt, isIntegralNumber, isLong, isMissingNode, isNull, isNumber, isObject, isPojo, isTextual, isValueNode, iterator, path, path, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected ContainerNode(JsonNodeFactory nc)
Method Detail |
---|
public boolean isContainerNode()
JsonNode
Note: one and only one of methods JsonNode.isValueNode()
,
JsonNode.isContainerNode()
and JsonNode.isMissingNode()
ever
returns true for any given node.
isContainerNode
in class JsonNode
public abstract JsonToken asToken()
BaseJsonNode
JsonToken
that equivalent
stream event would produce (for most nodes there is just
one token but for structured/container types multiple)
asToken
in class BaseJsonNode
public String getValueAsText()
JsonNode
JsonNode.isValueNode()
returns true), otherwise null.
Note: to serialize nodes of any type, you should call
JsonNode.toString()
instead.
getValueAsText
in class JsonNode
public abstract int size()
JsonNode
size
in class JsonNode
public abstract JsonNode get(int index)
JsonNode
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.
get
in class JsonNode
public abstract JsonNode get(String fieldName)
JsonNode
get
in class JsonNode
public final ArrayNode arrayNode()
public final ObjectNode objectNode()
public final NullNode nullNode()
public final BooleanNode booleanNode(boolean v)
public final NumericNode numberNode(byte v)
public final NumericNode numberNode(short v)
public final NumericNode numberNode(int v)
public final NumericNode numberNode(long v)
public final NumericNode numberNode(float v)
public final NumericNode numberNode(double v)
public final NumericNode numberNode(BigDecimal v)
public final TextNode textNode(String text)
public final BinaryNode binaryNode(byte[] data)
public final BinaryNode binaryNode(byte[] data, int offset, int length)
public final POJONode POJONode(Object pojo)
public abstract ContainerNode removeAll()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |