Enum JSONWriter.Feature

    • Enum Constant Detail

      • WriteNonStringValueAsString

        public static final JSONWriter.Feature WriteNonStringValueAsString
      • NotWriteHashMapArrayListClassName

        public static final JSONWriter.Feature NotWriteHashMapArrayListClassName
      • MapSortField

        public static final JSONWriter.Feature MapSortField
        Deprecated.
        The serialized Map will first be sorted according to Key, and is used in some scenarios where serialized content needs to be signed. SortedMap and derived classes do not need to do this. This Feature does not work for LinkedHashMap.
      • WriteNullStringAsEmpty

        public static final JSONWriter.Feature WriteNullStringAsEmpty
        Since:
        1.1
      • WriteNullNumberAsZero

        public static final JSONWriter.Feature WriteNullNumberAsZero
        Since:
        1.1
      • WriteNullBooleanAsFalse

        public static final JSONWriter.Feature WriteNullBooleanAsFalse
        Since:
        1.1
      • NotWriteEmptyArray

        public static final JSONWriter.Feature NotWriteEmptyArray
        Deprecated.
        use IgnoreEmpty
        Since:
        2.0.7
      • WriteNonStringKeyAsString

        public static final JSONWriter.Feature WriteNonStringKeyAsString
      • WritePairAsJavaBean

        public static final JSONWriter.Feature WritePairAsJavaBean
        Since:
        2.0.11
      • OptimizedForAscii

        public static final JSONWriter.Feature OptimizedForAscii
        Since:
        2.0.12
      • EscapeNoneAscii

        public static final JSONWriter.Feature EscapeNoneAscii
        Since:
        2.0.12 Feature that specifies that all characters beyond 7-bit ASCII range (i.e. code points of 128 and above) need to be output using format-specific escapes (for JSON, backslash escapes), if format uses escaping mechanisms (which is generally true for textual formats but not for binary formats). Feature is disabled by default.
      • WriteByteArrayAsBase64

        public static final JSONWriter.Feature WriteByteArrayAsBase64
        Since:
        2.0.13
      • IgnoreNonFieldGetter

        public static final JSONWriter.Feature IgnoreNonFieldGetter
        Since:
        2.0.13
      • WriteLongAsString

        public static final JSONWriter.Feature WriteLongAsString
        Since:
        2.0.17
      • WriteThrowableClassName

        public static final JSONWriter.Feature WriteThrowableClassName
        Since:
        2.0.30
      • NotWriteSetClassName

        public static final JSONWriter.Feature NotWriteSetClassName
        Since:
        2.0.34
      • NotWriteNumberClassName

        public static final JSONWriter.Feature NotWriteNumberClassName
        Since:
        2.0.34
      • SortMapEntriesByKeys

        public static final JSONWriter.Feature SortMapEntriesByKeys
        The serialized Map will first be sorted according to Key, and is used in some scenarios where serialized content needs to be signed. SortedMap and derived classes do not need to do this.
        Since:
        2.0.48
    • Field Detail

      • mask

        public final long mask
    • Method Detail

      • values

        public static JSONWriter.Feature[] 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.Feature c : JSONWriter.Feature.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.Feature valueOf​(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:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • isEnabled

        public boolean isEnabled​(long features)