Module json5

Class JSONOptions.JSONOptionsBuilder

  • Enclosing class:
    JSONOptions

    public static class JSONOptions.JSONOptionsBuilder
    extends java.lang.Object
    • Method Detail

      • parseUnixInstants

        public JSONOptions.JSONOptionsBuilder parseUnixInstants​(boolean parseUnixInstants)
        Whether or not unix instants (integers) should be parsed as such. Ignored if JSONOptions.isParseInstants() is false

        Default: true

        This is a Parser-only option

        Parameters:
        parseUnixInstants - a boolean
        Returns:
        this.
        Since:
        1.1.0
      • stringifyUnixInstants

        public JSONOptions.JSONOptionsBuilder stringifyUnixInstants​(boolean stringifyUnixInstants)
        Whether or not instants should be stringifyed as unix timestamps. If this is false, instants will be stringifyed as strings (according to RFC 3339, Section 5.6).

        Default: false

        This is a Stringify-only option

        Parameters:
        stringifyUnixInstants - a boolean
        Returns:
        this.
        Since:
        1.1.0
      • allowNaN

        public JSONOptions.JSONOptionsBuilder allowNaN​(boolean allowNaN)
        Whether or not NaN should be allowed as a number

        Default: true

        Parameters:
        allowNaN - a boolean
        Returns:
        this.
        Since:
        1.1.0
      • allowInfinity

        public JSONOptions.JSONOptionsBuilder allowInfinity​(boolean allowInfinity)
        Whether or not Infinity should be allowed as a number. This applies to both +Infinity and -Infinity

        Default: true

        Parameters:
        allowInfinity - a boolean
        Returns:
        this.
        Since:
        1.1.0
      • allowInvalidSurrogates

        public JSONOptions.JSONOptionsBuilder allowInvalidSurrogates​(boolean allowInvalidSurrogates)
        Whether or not invalid unicode surrogate pairs should be allowed

        Default: true

        This is a Parser-only option

        Parameters:
        allowInvalidSurrogates - a boolean
        Returns:
        this.
        Since:
        1.1.0
      • quoteSingle

        public JSONOptions.JSONOptionsBuilder quoteSingle​(boolean quoteSingle)
        Whether or not string should be single-quoted (') instead of double-quoted ("). This also includes a JSONObject's member names

        Default: false

        This is a Stringify-only option

        Parameters:
        quoteSingle - a boolean
        Returns:
        this.
        Since:
        1.1.0
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object