Interface Node

  • All Known Implementing Classes:
    JacksonNode

    interface Node
    A node representing a JSON structure. This class is a Pioneer abstraction which allows using different JSON parsers.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.stream.Stream<Node> elements()  
      java.util.Optional<Node> getNode​(java.lang.String name)
      Get the node value with the given name.
      boolean isArray()  
      <T> T toType​(java.lang.reflect.Type type)
      Convert this node into the requested type
      java.lang.Object value​(java.lang.reflect.Type typeHint)
      Get the value of the node.
    • Method Detail

      • isArray

        boolean isArray()
        Returns:
        true if the node represents an array of other nodes
      • elements

        java.util.stream.Stream<Node> elements()
        Returns:
        all the elements of this potential array node
      • toType

        <T> T toType​(java.lang.reflect.Type type)
        Convert this node into the requested type
        Type Parameters:
        T - the type
        Parameters:
        type - the type into which this node needs to be converted
        Returns:
        the converted type
      • getNode

        java.util.Optional<Node> getNode​(java.lang.String name)
        Get the node value with the given name.
        Parameters:
        name - the name of the node
        Returns:
        the node for the given name
      • value

        java.lang.Object value​(java.lang.reflect.Type typeHint)
        Get the value of the node.
        Parameters:
        typeHint - the potential type of the value
        Returns:
        the node value