Enum JSONReader.Feature

    • Enum Constant Detail

      • ErrorOnNoneSerializable

        public static final JSONReader.Feature ErrorOnNoneSerializable
        Since:
        2.0.14
      • SupportAutoType

        @Deprecated
        public static final JSONReader.Feature SupportAutoType
        Deprecated.
        It is not safe to explicitly turn on autoType, it is recommended to use AutoTypeBeforeHandler
      • UseDefaultConstructorAsPossible

        public static final JSONReader.Feature UseDefaultConstructorAsPossible
      • ErrorOnNotSupportAutoType

        public static final JSONReader.Feature ErrorOnNotSupportAutoType
      • DuplicateKeyValueAsArray

        public static final JSONReader.Feature DuplicateKeyValueAsArray
      • Base64StringAsByteArray

        public static final JSONReader.Feature Base64StringAsByteArray
        Since:
        2.0.13
      • ErrorOnNullForPrimitives

        public static final JSONReader.Feature ErrorOnNullForPrimitives
        Since:
        2.0.20
      • IgnoreAutoTypeNotMatch

        public static final JSONReader.Feature IgnoreAutoTypeNotMatch
        Since:
        2.0.21
      • NonZeroNumberCastToBooleanAsTrue

        public static final JSONReader.Feature NonZeroNumberCastToBooleanAsTrue
        Since:
        2.0.24
      • IgnoreNullPropertyValue

        public static final JSONReader.Feature IgnoreNullPropertyValue
        Since:
        2.0.40
      • ErrorOnUnknownProperties

        public static final JSONReader.Feature ErrorOnUnknownProperties
        Since:
        2.0.42
      • EmptyStringAsNull

        public static final JSONReader.Feature EmptyStringAsNull
        empty string "" convert to null
        Since:
        2.0.48
      • NonErrorOnNumberOverflow

        public static final JSONReader.Feature NonErrorOnNumberOverflow
        Since:
        2.0.48
      • UseBigIntegerForInts

        public static final JSONReader.Feature UseBigIntegerForInts
        Feature that determines whether JSON integral (non-floating-point) numbers are to be deserialized into BigIntegers if only generic type description (either Object or Number, or within untyped Map or Collection context) is available. If enabled such values will be deserialized as BigIntegers; if disabled, will be deserialized as "smallest" available type, which is either Integer, Long or BigInteger, depending on number of digits.

        Feature is disabled by default, meaning that "untyped" integral numbers will by default be deserialized using whatever is the most compact integral type, to optimize efficiency.

        Since:
        2.0.51
      • UseLongForInts

        public static final JSONReader.Feature UseLongForInts
        Feature that determines how "small" JSON integral (non-floating-point) numbers -- ones that fit in 32-bit signed integer (`int`) -- are bound when target type is loosely typed as Object or Number (or within untyped Map or Collection context). If enabled, such values will be deserialized as Long; if disabled, they will be deserialized as "smallest" available type, Integer.

        Note: if UseBigIntegerForInts is enabled, it has precedence over this setting, forcing use of BigInteger for all integral values.

        Feature is disabled by default, meaning that "untyped" integral numbers will by default be deserialized using Integer if value fits.

        Since:
        2.0.51
    • Field Detail

      • mask

        public final long mask
    • Method Detail

      • values

        public static JSONReader.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 (JSONReader.Feature c : JSONReader.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 JSONReader.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)
      • isEnabled

        public static boolean isEnabled​(long features,
                                        JSONReader.Feature feature)