com.fasterxml.jackson.databind.node

Class BaseJsonNode

    • Constructor Detail

      • BaseJsonNode

        protected BaseJsonNode()
    • Method Detail

      • findPath

        public final JsonNode findPath(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)
      • traverse

        public com.fasterxml.jackson.core.JsonParser traverse()
        Specified by:
        traverse in interface com.fasterxml.jackson.core.TreeNode
      • traverse

        public com.fasterxml.jackson.core.JsonParser traverse(com.fasterxml.jackson.core.ObjectCodec codec)
        Specified by:
        traverse in interface com.fasterxml.jackson.core.TreeNode
      • asToken

        public abstract com.fasterxml.jackson.core.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 interface com.fasterxml.jackson.core.TreeNode
      • numberType

        public com.fasterxml.jackson.core.JsonParser.NumberType numberType()
        Returns code that identifies type of underlying numeric value, if (and only if) node is a number node.
        Specified by:
        numberType in interface com.fasterxml.jackson.core.TreeNode
      • serialize

        public abstract void serialize(com.fasterxml.jackson.core.JsonGenerator jgen,
                     SerializerProvider provider)
                                throws IOException,
                                       com.fasterxml.jackson.core.JsonProcessingException
        Method called to serialize node instances using given generator.
        Specified by:
        serialize in interface JsonSerializable
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException
      • serializeWithType

        public abstract void serializeWithType(com.fasterxml.jackson.core.JsonGenerator jgen,
                             SerializerProvider provider,
                             TypeSerializer typeSer)
                                        throws IOException,
                                               com.fasterxml.jackson.core.JsonProcessingException
        Type information is needed, even if JsonNode instances are "plain" JSON, since they may be mixed with other types.
        Specified by:
        serializeWithType in interface JsonSerializable
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException

Copyright © 2012-2013 FasterXML. All Rights Reserved.