com.fasterxml.jackson.databind

Enum JsonNode.OverwriteMode

  • All Implemented Interfaces:
    Serializable, Comparable<JsonNode.OverwriteMode>
    Enclosing class:
    JsonNode


    public static enum JsonNode.OverwriteMode
    extends Enum<JsonNode.OverwriteMode>
    Configuration setting used with JsonNode.withObject(JsonPointer) method overrides, to indicate which overwrites are acceptable if the path pointer indicates has incompatible nodes (for example, instead of Object node a Null node is encountered). Overwrite means that the existing value is replaced with compatible type, potentially losing existing values or even sub-trees.

    Default value if NULLS which only allows Null-value nodes to be replaced but no other types.

    Since:
    2.14
    • Enum Constant Detail

      • NONE

        public static final JsonNode.OverwriteMode NONE
        Mode in which no values may be overwritten, not even NullNodes; only compatible paths may be traversed.
      • NULLS

        public static final JsonNode.OverwriteMode NULLS
        Mode in which explicit NullNodes may be replaced but no other node types.
      • SCALARS

        public static final JsonNode.OverwriteMode SCALARS
        Mode in which all scalar value nodes may be replaced, but not Array or Object nodes.
      • ALL

        public static final JsonNode.OverwriteMode ALL
        Mode in which all incompatible node types may be replaced, including Array and Object nodes where necessary.
    • Method Detail

      • values

        public static JsonNode.OverwriteMode[] 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 (JsonNode.OverwriteMode c : JsonNode.OverwriteMode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static JsonNode.OverwriteMode 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

Copyright © 2008–2023 FasterXML. All rights reserved.