public abstract class Node
extends java.lang.Object
Constructor and Description |
---|
Node() |
Modifier and Type | Method and Description |
---|---|
Node |
get(int idx)
If the node is of type NodeObj or NodeArray get() delivers the element with
index idx.
|
java.lang.String |
getAsString() |
java.lang.String |
getAsString(int columnOffset,
boolean hasLabel)
Delivers recursively a node and all of its children as a formatted string.
|
java.lang.String |
getAsStrippedString()
In JSON all strings are surrounded by quotation marks.
|
Node |
getNext()
If the node is of type NodeObj or NodeArray getNext() delivers the next
element (of type NodePair or NodeValue).
|
protected java.lang.String |
indent(int num)
Delivers a string consisting out of num spaces.
|
public java.lang.String getAsString()
public java.lang.String getAsStrippedString()
public java.lang.String getAsString(int columnOffset, boolean hasLabel)
columnOffset
- Number of spaces an element is indented.hasLabel
- If true this node starts in a line with a label. The
element must not be indented then but follows immediately
after the label.protected java.lang.String indent(int num)
num
- Number of spaces.public Node getNext()
public Node get(int idx)
idx
- Index of the wanted NodePair or NodeValue out of a list of these
elements.