Class JsonObject

  • All Implemented Interfaces:
    Json

    public class JsonObject
    extends Object
    implements Json
    • Constructor Detail

      • JsonObject

        public JsonObject​(Object... namesAndValues)
    • Method Detail

      • getWrapperClass

        public String getWrapperClass()
      • settingWrapperClass

        public JsonObject settingWrapperClass​(String wrapperClass)
      • isEmpty

        public boolean isEmpty()
      • toString

        public String toString​(int indentFactor)
        Make a pretty-printed JSON text of this JSONObject.

        Warning: This method assumes that the data structure is acyclic.

        Parameters:
        indentFactor - The number of spaces to add to each level of indentation.
        Returns:
        a printable, displayable, portable, transmittable representation of the object, beginning with { (left brace) and ending with } (right brace).
      • valueToString

        public static String valueToString​(Object value,
                                           int indentFactor,
                                           int indent)
        Make a prettyprinted JSON text of an object value.

        Warning: This method assumes that the data structure is acyclic.

        Parameters:
        value - The value to be serialized.
        indentFactor - The number of spaces to add to each level of indentation.
        indent - The indentation of the top level.
        Returns:
        a printable, displayable, transmittable representation of the object, beginning with { (left brace) and ending with } (right brace).
      • valueToString

        public static String valueToString​(Object value,
                                           int indentFactor,
                                           int indent,
                                           boolean alwaysQuoteKeys)
      • toString

        public String toString​(int indentFactor,
                               int indent)
        Make a prettyprinted JSON text of this JSONObject.

        Warning: This method assumes that the data structure is acyclical.

        Specified by:
        toString in interface Json
        Parameters:
        indentFactor - The number of spaces to add to each level of indentation.
        indent - The indentation of the top level.
        Returns:
        a printable, displayable, transmittable representation of the object, beginning with { (left brace) and ending with } (right brace).
      • stringify

        public String stringify()
      • stringify

        public String stringify​(int indentFactor)
      • toString

        public String toString​(int indentFactor,
                               int indent,
                               boolean alwaysQuoteKeys)
      • isIdentifier

        public static boolean isIdentifier​(String str)
      • set

        public void set​(String property,
                        Object value)
        Specified by:
        set in interface Json
      • add

        public void add​(JsonObject jsonObject)
      • settingConfigClass

        public void settingConfigClass​(String fullName)