Enum JsonWriter.OutputType

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      javascript
      Like JSON, but names are only double quoted if necessary.
      json
      Normal JSON, with all its double quotes.
      minimal
      Like JSON, but: Names only require double quotes if they start with space or any of ":,}/ or they contain // or /* or :.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String quoteName​(java.lang.String value)  
      java.lang.String quoteValue​(java.lang.Object value)  
      static JsonWriter.OutputType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static JsonWriter.OutputType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • javascript

        public static final JsonWriter.OutputType javascript
        Like JSON, but names are only double quoted if necessary.
      • minimal

        public static final JsonWriter.OutputType minimal
        Like JSON, but:
        • Names only require double quotes if they start with space or any of ":,}/ or they contain // or /* or :.
        • Values only require double quotes if they start with space or any of ":,{[]/ or they contain // or /* or any of }], or they are equal to true, false , or null.
        • Newlines are treated as commas, making commas optional in many cases.
        • C style comments may be used: //... or /*...*/
    • Method Detail

      • values

        public static JsonWriter.OutputType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (JsonWriter.OutputType c : JsonWriter.OutputType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static JsonWriter.OutputType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • quoteValue

        public java.lang.String quoteValue​(java.lang.Object value)
      • quoteName

        public java.lang.String quoteName​(java.lang.String value)