JSON Parser Xojo 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

BooleanValueSets or gets boolean value of the node.
ChildCountReturns number of child nodes that are under the node.
CommentSets or gets comment of a node
DoubleValueSets or gets double value of the node.
IntegerValueSets or gets integer value of the node.
NameSets or gets the name of the node
StringValueSets or gets string value of the node.
TypeReturns a type constant telling what type the node is.

Methods

AppendNodeAppends a child node.
AppendValueAppends a node as a value.
AppendValueAppends a boolean value.
AppendValueAppends a double value.
AppendValueAppends a integer value.
AppendValueAppends a string value.
ChildGets a child node by a index
ChildGets a child node by a name
ClearRemoves all child nodes from the node
CloneMakes a clone of the node so that it can be inserted to different tree or at different branch of the same tree.
GetSourceFormattedGets the raw JSON message as a string formatting it so that it is human readable.
GetSourceRawGets the raw JSON message as a string in as short format as possible.
shared NewArrayNodeA shared method that creates a new array node.
Operator_CompareThis 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.
PopRemoves a node by index and returns the removed node.
PopRemoves a node by name and returns the removed node.
RemoveRemoves a node by index.
RemoveRemoves a node by name.
shared StripWhiteSpaceShared method that strips white spaces from JSON message that is formatted to be easily human readable.
SwapSwaps the contents of two nodes

Constants

TYPE_NULL = 0
TYPE_STRING = 1
TYPE_DOUBLE = 2
TYPE_BOOL = 3
TYPE_ARRAY = 4
TYPE_NODE = 5
Version = 2.0

Supported Platforms:

  • macOS Intel 32 bit
  • macOS Intel 64 bit
  • macOS Apple Silicon
  • Windows 32 bit
  • Windows 64 bit
  • Windows ARM 64 bit
  • Linux 32 bit
  • Linux 64 bit
  • Linux ARM 32 bit
  • iOS