Class RMJSONNode
java.lang.Object
com.inductiveautomation.rm.archiver.RMJSONNode
Represents a node in a JSON tree.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget
(int anIndex) Returns the individual node at given index.Returns value for key if node type Map.Returns the value as Map if type is Map.protected RMJSONNode
Returns a JSON node of given value.getKeys()
Returns keys list.getList()
Returns the value as List if type is List.getMap()
Returns the value as Map if type is Map.Converts a JSON object to Map.Returns the value as Number if type is Number.Returns the value as String if type is String.getType()
Returns the the node type.getValue()
Returns the value.static void
Simple main implementation to read standard in and re-print JSON.Sets value for key.static RMJSONNode
readSource
(Object aSource) Creates a JSON node tree from a JSON string or JSON String byte source.protected void
setType
(RMJSONNode.Type aType) Sets the node type.protected RMJSONNode
Sets the value.int
size()
Returns the number of JSON nodes if node type List.toString()
Returns a string representation of node (as JSON, of course).Returns a string representation of node (as JSON, of course).
-
Constructor Details
-
RMJSONNode
public RMJSONNode()Creates a new node. -
RMJSONNode
Creates a new node.
-
-
Method Details
-
readSource
Creates a JSON node tree from a JSON string or JSON String byte source.- Throws:
RMJSONReader.RMJSONException
-
getType
Returns the the node type. -
setType
Sets the node type. -
getValue
Returns the value. -
setValue
Sets the value. -
get
Returns value for key if node type Map. -
put
Sets value for key. -
getKeys
Returns keys list. -
size
public int size()Returns the number of JSON nodes if node type List. -
get
Returns the individual node at given index. -
getJSON
Returns a JSON node of given value. -
getMap
Returns the value as Map if type is Map. -
getList
Returns the value as List if type is List. -
getString
Returns the value as String if type is String. -
getNumber
Returns the value as Number if type is Number. -
getBoolean
Returns the value as Map if type is Map. -
getNonJSON
Converts a JSON object to Map. -
toString
Returns a string representation of node (as JSON, of course). -
toStringCompacted
Returns a string representation of node (as JSON, of course). -
main
Simple main implementation to read standard in and re-print JSON.
-