Package org.elkoserver.json

Utilities for working with JSON (JavaScript Object Notation) objects.

See: Description

Package org.elkoserver.json Description

Utilities for working with JSON (JavaScript Object Notation) objects.

The JavaScript Object Notation,or JSON (pronounced JAY-son, as in Jason And The Argonauts), is a subset of JavaScript's object literal notation. JavaScript (aka ECMAScript) is defined in ECMA Standard ECMA-404. It is more expressive than XML, easier for humans to read and write, easier for machines to parse and manipulate, and produces much smaller payloads. There is a complete JSON parser built into every modern web browser. This syntax is also supported, either directly or via libraries, by numerous other languages.

object-literal :
{ property-list }
{}
property-list :
identifier : value
string-literal : value
property-list , string-literal : value
value :
string-literal
numeric-literal
object-literal
array-literal
true
false
null
array-literal :
[ element-list ]
[]
element-list :
value
element-list , value

It is strictly illegal to put blank lines within a message, or to put a line terminating character inside a string literal.

Strings can be contained within double quotes "..." or single quotes '...'. UTF-8 encoding is used. Escapement uses the '\' character.

Numbers follow the C convention, except that octal notation is not permitted; a leading zero must be immediately followed by a decimal point or the letter x.

Elko uses JSON as its inter-system message syntax.

By convention, a JSON object which represents an inter-system message will have two string-valued properties to: and op:, which respectively designate the message target (i.e., the object the which the message is being directed) and the message verb. Similarly, a JSON object which represents a structure that is being transmitted as a message parameter or stored in an external persistent medium (e.g., a database) will have a string-valued property type: which denotes the kind of structure being represented.

Copyright © 2017. All rights reserved.