JSON Parser Xojo and Real Studio plugin

JSONNode Class (console safe)

The JSONNode class represents the tree structure of the JSON message. The node can represent top of the tree or any node in the tree.

Note that a node cannot be attached in two places in the tree or to two separate trees, the class will prevent that.

Object
   JSONNode

class JSONNode

Constructors

JSONNodeConstructor that constructs a empty root node.
JSONNodeConstructor that constructs a node that has a name but no value
JSONNodeConstructor that constructs a node that has a name and a string value
JSONNodeConstructor that constructs a node that has a name and a integer value
JSONNodeConstructor that constructs a node that has a name and a double value
JSONNodeConstructor that constructs a node that has a name and a boolean value

Properties

BooleanValue (console safe) Sets or gets boolean value of the node.
ChildCount (console safe) Returns number of child nodes that are under the node.
Comment (console safe) Sets or gets comment of a node
DoubleValue (console safe) Sets or gets double value of the node.
IntegerValue (console safe) Sets or gets integer value of the node.
Name (console safe) Sets or gets the name of the node
StringValue (console safe) Sets or gets string value of the node.
Type (console safe) Returns a type constant telling what type the node is.

Methods

AppendNode (console safe) Appends a child node.
AppendValue (console safe) Appends a boolean value.
AppendValue (console safe) Appends a node as a value.
AppendValue (console safe) Appends a double value.
AppendValue (console safe) Appends a integer value.
AppendValue (console safe) Appends a string value.
Child (console safe) Gets a child node by a index
Child (console safe) Gets a child node by a name
Clear (console safe) Removes all child nodes from the node
Clone (console safe) Makes a clone of the node so that it can be inserted to different tree or at different branch of the same tree.
GetSourceFormatted (console safe) Gets the raw JSON message as a string formatting it so that it is human readable.
GetSourceRaw (console safe) Gets the raw JSON message as a string in as short format as possible.
shared NewArrayNodeA shared method that creates a new array node.
Operator_Compare (console safe) This is overload on the REAL studio = operator. Compares two nodes to see if they are equal
shared ParseA shared method that parses a JSON string message into a structured JSON object tree.
Pop (console safe) Removes a node by name and returns the removed node.
Pop (console safe) Removes a node by index and returns the removed node.
Remove (console safe) Removes a node by name.
Remove (console safe) Removes a node by index.
shared StripWhiteSpaceShared method that strips white spaces from JSON message that is formatted to be easily human readable.
Swap (console safe) Swaps the contents of two nodes

Constants

TYPE_NULL = 0There is no valid node
TYPE_STRING = 1String node
TYPE_DOUBLE = 2Double node
TYPE_BOOL = 3Boolean node
TYPE_ARRAY = 4Array node
TYPE_NODE = 5Node

Supported Platforms:

  • MacOS X Carbon
  • MacOS X Cocoa
  • Win32 - Windows
  • Linux x86

    Unsupported Platforms: