Class JsonPath

java.lang.Object
com.inductiveautomation.ignition.common.JsonPath
All Implemented Interfaces:
Serializable

public class JsonPath extends Object implements Serializable
A property path represents a location in a JSON document. For example: foo.bar[5].baz

Implemented as a singly-linked list where each PropertyPath represents one part of the path, linked to its parent.

See Also:
  • Field Details

    • ROOT

      public static final JsonPath ROOT
      Special path which represents the root of all paths. Is the ancestor of any path except itself. For example, this would be the parent of the path "foo"
  • Method Details

    • isRoot

      public boolean isRoot()
    • getDepth

      public int getDepth()
    • getKey

      public Object getKey()
    • getStringPathPart

      protected String getStringPathPart()
    • getParent

      public JsonPath getParent()
    • getPathElements

      public JsonPath[] getPathElements()
      Returns the elements in this path's parent chain in order from ROOT downwards
    • getAsLinkedList

      public LinkedList<JsonPath> getAsLinkedList()
    • getSubPath

      public JsonPath getSubPath(int startingDepth)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isAncestorOf

      public boolean isAncestorOf(JsonPath element)
    • isRelatedTo

      public boolean isRelatedTo(JsonPath other)
      Returns true if any of the following are true:
      1. This path is equal to the given path
      2. This path is an ancestor of the given path
      3. The given path is an ancestor of this path
    • isValidIdentifier

      public static boolean isValidIdentifier(String test)
    • createChildPath

      public JsonPath createChildPath(String childKey)
    • createChildPath

      public JsonPath createChildPath(int index)
    • createChildPath

      public JsonPath createChildPath(JsonPath subElement)
      For creating subpaths, will return a cloned element with this as the new parent.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • parse

      public static JsonPath parse(String path)