public class JValueNode<V> extends AbstractJNode
parent, type| Constructor and Description |
|---|
JValueNode()
Default constructor for detached node.
|
JValueNode(JNode fParent)
Constructor for node attached to tree.
|
JValueNode(JNode fParent,
V val)
Constructor for node attached to tree.
|
JValueNode(V val)
Constructor for detached node.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNode(JNode node)
Add element to composite node (without name).
|
<K,T extends JNode> |
addNode(K idx,
T node)
Add element to composite node.
|
JNode |
clone()
Return copy of this object, detached from node tree.
|
boolean |
equals(java.lang.Object obj) |
<T> JNode |
getNode(T selector)
Returns child node of this node by selector.
|
V |
getValue()
Return value of JValueNode.
|
<V1> V1 |
getValue(java.lang.Class<V1> pType)
Return value of JValueNode.
|
int |
hashCode() |
<N extends JNode> |
removeNode(N node)
Remove child node of this node.
|
<T> void |
removeNode(T selector)
Remove child node of this node by selector.
|
<V1> void |
setValue(V1 value)
Set value of V type for this node.
|
java.lang.String |
toJson()
Return this node as a JSON document.
|
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String indent,
boolean showPath,
boolean deep)
Return printable (well formatted) text represents this node.
|
fieldNames, getChildren, getDocRoot, getKey, getParent, getPath, getType, iterator, setKeypublic JValueNode()
public JValueNode(V val)
val - value of the node.public JValueNode(JNode fParent)
fParent - parent node in tree.public JNode clone()
JNodeclone in interface JNodeclone in class AbstractJNodepublic V getValue()
JNodegetValue in interface JNodegetValue in class AbstractJNodepublic <V1> V1 getValue(java.lang.Class<V1> pType)
JNodegetValue in interface JNodegetValue in class AbstractJNodeV1 - type of returned value: Integer, Boolean, Float, Double or String.pType - class that represents returned value.public <V1> void setValue(V1 value)
JNodesetValue in interface JNodesetValue in class AbstractJNodeV1 - type of valuevalue - to set for the node.public <T> JNode getNode(T selector)
JNodeT - type of the selector: Integer or String.selector - is index or key.public <K,T extends JNode> void addNode(K idx, T node)
JNodeK - class of key (String for field name, Integer for node in JArray).T - class of added node.idx - name of the fieldnode - to be added.public void addNode(JNode node)
JNodenode - to be added.public <T> void removeNode(T selector)
JNodeT - type of the selector: Integer or String.selector - is index or key.public <N extends JNode> void removeNode(N node)
JNodeN - type of nodenode - to removepublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(java.lang.String indent,
boolean showPath,
boolean deep)
JNodeindent - represent indentation for formatting text.showPath - if true then the method insert path information in output.deep - if true then the method will output children recursively.public java.lang.String toJson()
JNodepublic int hashCode()
hashCode in class AbstractJNodepublic boolean equals(java.lang.Object obj)
equals in class AbstractJNode