Class JSUtilities.JSON

java.lang.Object
org.bzdev.util.JSUtilities.JSON
Direct Known Subclasses:
JSUtilities.YAML, NJSUtilities.JSON
Enclosing class:
JSUtilities

public static class JSUtilities.JSON extends Object
Methods for parsing and generating JSON. All the public methods of this class are static. An extended syntax is used for parsing (but not for writing):
  • Comments consist of the sequence '//', not within a string, and contain all characters up to the end of a line. Comments will be silently dropped and are allowed only where whitespace is allowed.
  • For a JSON object in a key/value pair, quoting the key is optional when the key is syntactically a Java identifier.
These extensions are useful when a file containing JSON-formated values is used as an input to a program. The object returned by the parser can be used to configure a named-object factory (using the syntax described in the documentation for NamedObjectFactory<F extends NamedObjectFactory<F,NMR,NMD,OBJ>,NMR extends ObjectNamerOps<NMD>,NMD extends NamedObjectOps,OBJ extends NMD>.