Class JsonPath
- java.lang.Object
-
- com.inductiveautomation.ignition.common.JsonPath
-
public class JsonPath extends java.lang.Object
A property path represents a location in a JSON document. For example: foo.bar[5].bazImplemented as a singly-linked list where each PropertyPath represents one part of the path, linked to its parent.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonPath
createChildPath(int index)
JsonPath
createChildPath(java.lang.String childKey)
boolean
equals(java.lang.Object obj)
java.util.LinkedList<JsonPath>
getAsLinkedList()
int
getDepth()
java.lang.Object
getKey()
JsonPath
getParent()
JsonPath[]
getPathElements()
Returns the elements in this path's parent chain in order from ROOT downwardsint
hashCode()
boolean
isAncestorOf(JsonPath element)
boolean
isRelatedTo(JsonPath other)
Returns true if any of the following are true: This path is equal to the given path This path is an ancestor of the given path The given path is an ancestor of this pathboolean
isRoot()
static boolean
isValidIdentifier(java.lang.String test)
static JsonPath
parse(java.lang.String path)
java.lang.String
toString()
-
-
-
Field Detail
-
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 Detail
-
isRoot
public boolean isRoot()
-
getDepth
public int getDepth()
-
getKey
public java.lang.Object getKey()
-
getParent
public JsonPath getParent()
-
getPathElements
public JsonPath[] getPathElements()
Returns the elements in this path's parent chain in order from ROOT downwards
-
getAsLinkedList
public java.util.LinkedList<JsonPath> getAsLinkedList()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
isAncestorOf
public boolean isAncestorOf(JsonPath element)
-
isRelatedTo
public boolean isRelatedTo(JsonPath other)
Returns true if any of the following are true:- This path is equal to the given path
- This path is an ancestor of the given path
- The given path is an ancestor of this path
-
isValidIdentifier
public static boolean isValidIdentifier(java.lang.String test)
-
createChildPath
public JsonPath createChildPath(java.lang.String childKey)
-
createChildPath
public JsonPath createChildPath(int index)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
parse
public static JsonPath parse(java.lang.String path)
-
-