Interface JsonNode
-
- All Known Implementing Classes:
JsonFieldFormat,JsonWrapper
public interface JsonNodeAn interface implemented by any JSON segment or field.- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetJsonArrayIndex()Returns the index of this node in its parent array, or -1 if not applicable (i.e.java.lang.StringgetJsonName()Returns the JSON field name.chargetJsonType()Returns the type of node.java.lang.StringgetName()Returns the field name.booleanisJsonArray()Returns whether this node is a JSON array.booleanisNillable()Returns whether this node may be explicitly set tonull.
-
-
-
Field Detail
-
OBJECT
static final char OBJECT
JSON object type- See Also:
- Constant Field Values
-
ARRAY
static final char ARRAY
JSON array type- See Also:
- Constant Field Values
-
STRING
static final char STRING
JSON string type- See Also:
- Constant Field Values
-
NUMBER
static final char NUMBER
JSON number type- See Also:
- Constant Field Values
-
BOOLEAN
static final char BOOLEAN
JSON boolean type- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
java.lang.String getName()
Returns the field name.- Returns:
- the field name
-
getJsonName
java.lang.String getJsonName()
Returns the JSON field name.- Returns:
- the JSON field name
-
getJsonType
char getJsonType()
Returns the type of node. IfisJsonArray()is true, this method returns the component type of the array.- Returns:
- the node type
-
isJsonArray
boolean isJsonArray()
Returns whether this node is a JSON array.- Returns:
- true if this node a JSON array, false otherwise
-
getJsonArrayIndex
int getJsonArrayIndex()
Returns the index of this node in its parent array, or -1 if not applicable (i.e. its parent is an object).- Returns:
- the index of this node in its parent array
-
isNillable
boolean isNillable()
Returns whether this node may be explicitly set tonull.- Returns:
- true if this node value may be set to
null, false otherwise
-
-