|
JSON Version 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.jackson.map.JsonNode
org.codehaus.jackson.map.impl.MissingNode
public final class MissingNode
This singleton node class is generated to denote "missing nodes" along paths that do not exist. For example, if a path via element of an array is requested for an element outside range of elements in the array; or for a non-array value, result will be reference to this node.
Method Summary | |
---|---|
boolean |
equals(Object o)
Let's mark this standard method as abstract to ensure all implementation classes define it |
static MissingNode |
getInstance()
|
JsonNode |
getPath(int index)
This method is similar to JsonNode.getElementValue(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 |
getPath(String fieldName)
This method is similar to JsonNode.getFieldValue(java.lang.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 |
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 |
isMissingNode()
Method that returns true for "virtual" nodes which represent missing entries constructed by path accessor methods when there is no actual node matching given criteria. |
String |
toString()
Let's mark this standard method as abstract to ensure all implementation classes define it |
void |
writeTo(JsonGenerator jg)
Method that can be called to serialize this node and all of its descendants using specified JSON generator. |
Methods inherited from class org.codehaus.jackson.map.JsonNode |
---|
appendElement, getBooleanValue, getDecimalValue, getDoubleValue, getElements, getElementValue, getFieldNames, getFieldValue, getFieldValues, getIntValue, getLongValue, getNumberValue, getTextValue, insertElement, isArray, isBigDecimal, isBoolean, isContainerNode, isDouble, isFloatingPointNumber, isInt, isIntegralNumber, isLong, isNull, isNumber, isObject, isTextual, isValueNode, removeElement, removeElement, reportNoArrayMods, reportNoObjectMods, setElement, setElement, size |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static MissingNode getInstance()
public boolean isMissingNode()
JsonNode
Note: one and only one of methods JsonNode.isValueNode()
,
JsonNode.isContainerNode()
and JsonNode.isMissingNode()
ever
returns true for any given node.
isMissingNode
in class JsonNode
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 JsonNode getPath(String fieldName)
JsonNode
JsonNode.getFieldValue(java.lang.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.
getPath
in class JsonNode
public JsonNode getPath(int index)
JsonNode
JsonNode.getElementValue(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.
getPath
in class JsonNode
public void writeTo(JsonGenerator jg) throws IOException, JsonGenerationException
JsonNode
writeTo
in class JsonNode
IOException
JsonGenerationException
public boolean equals(Object o)
JsonNode
equals
in class JsonNode
public String toString()
JsonNode
toString
in class JsonNode
|
JSON Version 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |