Interface JsonNode

All Known Implementing Classes:
GsonNode, JacksonNode, JakartaJsonNode, JettisonNode, JsonSmartNode, KotlinxJsonNode, OrgJsonNode, SnakeYamlNode

public interface JsonNode
JsonNode interface is the main abstraction for provider-agnostic JSON node.
  • Method Details

    • encodeJsonPointer

      static String encodeJsonPointer(String pointer)
      Encodes all illegal characters in JSON pointer segment
      Parameters:
      pointer - JSON pointer segment
      Returns:
      encoded JSON pointer segment
    • getJsonPointer

      String getJsonPointer()
      JSON pointer getter.
      Returns:
      JSON pointer
    • getNodeType

      SimpleType getNodeType()
      Node type getter
      Returns:
      type of node
    • isNull

      default boolean isNull()
      Checks if JSON node is null.
    • isBoolean

      default boolean isBoolean()
      Checks if JSON node is a boolean.
    • isString

      default boolean isString()
      Checks if JSON node is a string.
    • isInteger

      default boolean isInteger()
      Checks if JSON node is an integer.
    • isNumber

      default boolean isNumber()
      Checks if JSON node is a number.
    • isArray

      default boolean isArray()
      Checks if JSON node is an array.
    • isObject

      default boolean isObject()
      Checks if JSON node is an object.
    • asBoolean

      boolean asBoolean()
      Returns JSON node as a boolean. If JSON node is not of a boolean type, then the behaviour is undefined.
    • asString

      String asString()
      Returns JSON node as a string. If JSON node is not of a string type, then the behaviour is undefined.
    • asInteger

      BigInteger asInteger()
      Returns JSON node as an integer. If JSON node is not of an integer type, then the behaviour is undefined.
    • asNumber

      BigDecimal asNumber()
      Returns JSON node as a number. If JSON node is not of a number type, then the behaviour is undefined.
    • asArray

      List<JsonNode> asArray()
      Returns JSON node as an array. If JSON node is not of an array type, then the behaviour is undefined.
    • asObject

      Map<String,JsonNode> asObject()
      Returns JSON node as an object. If JSON node is not of an object type, then the behaviour is undefined.
    • toPrintableString

      default String toPrintableString()
      Converts JSON node to printable string. This method is only used for validation messages construction.