Class JsonNodes


  • public class JsonNodes
    extends java.lang.Object
    Utility methods for JsonNode.
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonNodes()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T extends com.fasterxml.jackson.databind.JsonNode>
      T
      get​(com.fasterxml.jackson.databind.JsonNode node, JsonNodePath path)
      Gets the node found at the path.
      static <T extends com.fasterxml.jackson.databind.JsonNode>
      T
      get​(com.fasterxml.jackson.databind.JsonNode node, java.lang.Object propertyOrIndex)
      Gets the node given the property or index.
      static com.fasterxml.jackson.databind.JsonNode readTree​(com.fasterxml.jackson.databind.ObjectMapper objectMapper, java.io.InputStream inputStream, JsonNodeFactoryFactory jsonNodeFactoryFactory)
      Read a JsonNode from an InputStream.
      static com.fasterxml.jackson.databind.JsonNode readTree​(com.fasterxml.jackson.databind.ObjectMapper objectMapper, java.lang.String content, JsonNodeFactoryFactory jsonNodeFactoryFactory)
      Read a JsonNode from String content.
      static com.fasterxml.jackson.core.JsonLocation tokenLocationOf​(com.fasterxml.jackson.databind.JsonNode jsonNode)
      Gets the token location of the JsonNode that implements JsonLocationAware.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JsonNodes

        public JsonNodes()
    • Method Detail

      • get

        public static <T extends com.fasterxml.jackson.databind.JsonNode> T get​(com.fasterxml.jackson.databind.JsonNode node,
                                                                                JsonNodePath path)
        Gets the node found at the path.
        Type Parameters:
        T - the type of the node
        Parameters:
        node - the node
        path - the path
        Returns:
        the node found at the path or null
      • get

        public static <T extends com.fasterxml.jackson.databind.JsonNode> T get​(com.fasterxml.jackson.databind.JsonNode node,
                                                                                java.lang.Object propertyOrIndex)
        Gets the node given the property or index.
        Type Parameters:
        T - the type of the node
        Parameters:
        node - the node
        propertyOrIndex - the property or index
        Returns:
        the node given the property or index
      • readTree

        public static com.fasterxml.jackson.databind.JsonNode readTree​(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                                                       java.lang.String content,
                                                                       JsonNodeFactoryFactory jsonNodeFactoryFactory)
        Read a JsonNode from String content.
        Parameters:
        objectMapper - the object mapper
        content - the string content
        jsonNodeFactoryFactory - the factory
        Returns:
        the json node
      • readTree

        public static com.fasterxml.jackson.databind.JsonNode readTree​(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                                                       java.io.InputStream inputStream,
                                                                       JsonNodeFactoryFactory jsonNodeFactoryFactory)
        Read a JsonNode from an InputStream.
        Parameters:
        objectMapper - the object mapper
        inputStream - the string content
        jsonNodeFactoryFactory - the factory
        Returns:
        the json node
      • tokenLocationOf

        public static com.fasterxml.jackson.core.JsonLocation tokenLocationOf​(com.fasterxml.jackson.databind.JsonNode jsonNode)
        Gets the token location of the JsonNode that implements JsonLocationAware.
        Parameters:
        jsonNode - the node
        Returns:
        the JsonLocation