Class Json

java.lang.Object
gw.lang.reflect.json.Json

public class Json extends Object
  • Field Details

  • Constructor Details

    • Json

      public Json()
  • Method Details

    • getParserName

      public static String getParserName()
    • setParserName

      public static void setParserName(String fqn)
    • fromJson

      public static Bindings fromJson(String json)
      Parse the JSON string as one of a javax.script.Bindings instance.
      Parameters:
      json - A Standard JSON formatted string
      Returns:
      A javax.script.Bindings instance
    • makeStructureTypes

      public static String makeStructureTypes(String nameForStructure, Bindings bindings, boolean mutable)
      Makes a tree of structure types reflecting the Bindings.

      A structure type contains a property member for each name/value pair in the Bindings. A property has the same name as the key and follows these rules:

      • If the type of the value is a "simple" type, such as a String or Integer, the type of the property matches the simple type exactly
      • Otherwise, if the value is a Bindings type, the property type is that of a child structure with the same name as the property and recursively follows these rules
      • Otherwise, if the value is a List, the property is a List parameterized with the component type, and the component type recursively follows these rules
    • transformJsonObject

      private static IJsonType transformJsonObject(String name, IJsonParentType parent, Object jsonObj)
    • mergeTypes

      public static IJsonType mergeTypes(IJsonType type1, IJsonType type2)