org.codehaus.jackson.node
Class ValueNode

java.lang.Object
  extended by org.codehaus.jackson.JsonNode
      extended by org.codehaus.jackson.node.BaseJsonNode
          extended by org.codehaus.jackson.node.ValueNode
All Implemented Interfaces:
Iterable<JsonNode>, JsonSerializable
Direct Known Subclasses:
BinaryNode, BooleanNode, NullNode, NumericNode, POJONode, TextNode

public abstract class ValueNode
extends BaseJsonNode

This intermediate base class is used for all leaf nodes, that is, all non-container (array or object) nodes, except for the "missing node".


Constructor Summary
protected ValueNode()
           
 
Method Summary
 boolean isValueNode()
          Method that returns true for all value nodes: ones that are not containers, and that do not represent "missing" nodes in the path.
 JsonNode path(int index)
          This method is similar to JsonNode.get(int), except that instead of returning null if no such element exists (due to index being out of range, or this node not being an array), a "missing node" (node that returns true for JsonNode.isMissingNode()) will be returned.
 JsonNode path(String fieldName)
          This method is similar to JsonNode.get(String), except that instead of returning null if no such value exists (due to this node not being an object, or object not having value for the specified field), a "missing node" (node that returns true for JsonNode.isMissingNode()) will be returned.
 String toString()
           Note: marked as abstract to ensure all implementation classes define it properly.
 
Methods inherited from class org.codehaus.jackson.node.BaseJsonNode
serialize, writeTo
 
Methods inherited from class org.codehaus.jackson.JsonNode
equals, get, get, getBigIntegerValue, getBinaryValue, getBooleanValue, getDecimalValue, getDoubleValue, getElements, getElementValue, getFieldNames, getFieldValue, getIntValue, getLongValue, getNumberValue, getPath, getPath, getTextValue, getValueAsText, isArray, isBigDecimal, isBigInteger, isBinary, isBoolean, isContainerNode, isDouble, isFloatingPointNumber, isInt, isIntegralNumber, isLong, isMissingNode, isNull, isNumber, isObject, isPojo, isTextual, iterator, size
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValueNode

protected ValueNode()
Method Detail

isValueNode

public boolean isValueNode()
Description copied from class: JsonNode
Method that returns true for all value nodes: ones that are not containers, and that do not represent "missing" nodes in the path. Such value nodes represent String, Number, Boolean and null values from JSON.

Note: one and only one of methods JsonNode.isValueNode(), JsonNode.isContainerNode() and JsonNode.isMissingNode() ever returns true for any given node.

Overrides:
isValueNode in class JsonNode

path

public JsonNode path(String fieldName)
Description copied from class: JsonNode
This method is similar to JsonNode.get(String), except that instead of returning null if no such value exists (due to this node not being an object, or object not having value for the specified field), a "missing node" (node that returns true for JsonNode.isMissingNode()) will be returned. This allows for convenient and safe chained access via path calls.

Specified by:
path in class JsonNode

path

public JsonNode path(int index)
Description copied from class: JsonNode
This method is similar to JsonNode.get(int), except that instead of returning null if no such element exists (due to index being out of range, or this node not being an array), a "missing node" (node that returns true for JsonNode.isMissingNode()) will be returned. This allows for convenient and safe chained access via path calls.

Specified by:
path in class JsonNode

toString

public String toString()
Description copied from class: JsonNode

Note: marked as abstract to ensure all implementation classes define it properly.

Specified by:
toString in class JsonNode