Class BaseJsonNode

    • Constructor Detail

      • BaseJsonNode

        protected BaseJsonNode()
    • Method Detail

      • findValue

        public JsonNode findValue​(java.lang.String fieldName)
        Description copied from class: JsonNode
        Method for finding a JSON Object field with specified name in this node or its child nodes, and returning value it has. If no matching field is found in this node or its descendants, returns null.
        Specified by:
        findValue in class JsonNode
        Parameters:
        fieldName - Name of field to look for
        Returns:
        Value of first matching node found, if any; null if none
      • findPath

        public final JsonNode findPath​(java.lang.String fieldName)
        Description copied from class: JsonNode
        Method similar to JsonNode.findValue(java.lang.String), but that will return a "missing node" instead of null if no field is found. Missing node is a specific kind of node for which JsonNode.isMissingNode() returns true; and all value access methods return empty or missing value.
        Specified by:
        findPath in class JsonNode
        Parameters:
        fieldName - Name of field to look for
        Returns:
        Value of first matching node found; or if not found, a "missing node" (non-null instance that has no value)
      • findParent

        public ObjectNode findParent​(java.lang.String fieldName)
        Description copied from class: JsonNode
        Method for finding a JSON Object that contains specified field, within this node or its descendants. If no matching field is found in this node or its descendants, returns null.
        Specified by:
        findParent in class JsonNode
        Parameters:
        fieldName - Name of field to look for
        Returns:
        Value of first matching node found, if any; null if none
      • findValues

        public java.util.List<JsonNode> findValues​(java.lang.String fieldName,
                                                   java.util.List<JsonNode> foundSoFar)
        Specified by:
        findValues in class JsonNode
      • findValuesAsText

        public java.util.List<java.lang.String> findValuesAsText​(java.lang.String fieldName,
                                                                 java.util.List<java.lang.String> foundSoFar)
        Specified by:
        findValuesAsText in class JsonNode
      • findParents

        public java.util.List<JsonNode> findParents​(java.lang.String fieldName,
                                                    java.util.List<JsonNode> foundSoFar)
        Specified by:
        findParents in class JsonNode
      • traverse

        public JsonParser traverse()
        Description copied from class: JsonNode
        Method for constructing a JsonParser instance for iterating over contents of the tree that this node is root of. Functionally equivalent to first serializing tree using ObjectCodec and then re-parsing but more efficient.
        Specified by:
        traverse in class JsonNode
      • asToken

        public abstract JsonToken asToken()
        Method that can be used for efficient type detection when using stream abstraction for traversing nodes. Will return the first JsonToken that equivalent stream event would produce (for most nodes there is just one token but for structured/container types multiple)
        Specified by:
        asToken in class JsonNode
        Since:
        1.3