Class QualifiedPath
java.lang.Object
com.inductiveautomation.ignition.common.QualifiedPath
- All Implemented Interfaces:
Path
,Serializable
This class is a path to anything in Ignition, across any system. It dictates
how the path is formed, but the actual meaning of different subcomponents
will depend on the context in which the path is used.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A builder to assist in constructingQualifiedPath
s.static class
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
Fields inherited from interface com.inductiveautomation.ignition.common.Path
SERIALIZATION_WHITELIST
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
Returns a path with the provided component added on at the end.Convenience function to return the last path element.Returns a path representing the element above the current path.getPart
(int i) protected QualifiedPath.Part[]
getPartsFor
(String id) Returns all of the sub parts for a specified id, or null if they don't exist.getPathComponent
(int i) Returns the path element at the specified location.getPathComponentOrElse
(String id, String orElse) int
Returns the number of elements in the path, which can be retrieved through getPathComponent().int
hashCode()
boolean
protected int
Locates the component specified and inserts the new component before it.boolean
isAncestorOf
(Path child) Returns whether the provided path is a child path of this one.static QualifiedPath
Creates a path out of the specified id/value pairs.static QualifiedPath
Attempts to parse the string into an QualifiedPath.static QualifiedPath
Same as parse(), but catches exceptions and returns null on bad paths.protected static List<QualifiedPath.Part>
parseSubParts
(String id, String value) Returns at least one part for the root, with id.Returns a new path with the provided component added at the beginning.Removes the given component, if present.If the component specified by the given id exists in the path, the value will be replaced with the new value.strip()
Removes the last fully-qualified component from the path.subpath()
Removes the first path component and returns the rest as a new path.Returns the paths that comes after the first instance of the specified id.toString()
Returns the path in a friendlier to read form, without component ids.
-
Field Details
-
SUBPART_SEPERATOR
- See Also:
-
PART_SEPERATOR
- See Also:
-
COMPONENTID_SEPERATOR
- See Also:
-
-
Constructor Details
-
QualifiedPath
public QualifiedPath()
-
-
Method Details
-
clone
-
of
Creates a path out of the specified id/value pairs. The parameters must be in the form "id,value,id,value". -
extend
Returns a path with the provided component added on at the end. -
prepend
Returns a new path with the provided component added at the beginning. -
insert
Locates the component specified and inserts the new component before it. -
getPathLength
public int getPathLength()Description copied from interface:Path
Returns the number of elements in the path, which can be retrieved through getPathComponent().- Specified by:
getPathLength
in interfacePath
-
getPart
-
getPathComponent
Description copied from interface:Path
Returns the path element at the specified location.- Specified by:
getPathComponent
in interfacePath
-
getLastPathComponent
Description copied from interface:Path
Convenience function to return the last path element.- Specified by:
getLastPathComponent
in interfacePath
-
getLastPathComponentId
-
getFirstPathComponent
-
getFirstPathComponentId
-
subpath
Removes the first path component and returns the rest as a new path. -
subpath
Returns the paths that comes after the first instance of the specified id.- Parameters:
id
- component id after which the subsequent path parts will be returned.- Returns:
- everything after the specified id, or null if id is not found.
-
strip
Removes the last fully-qualified component from the path. This differs from getParentPath() in that that function doesn't care whether the component is qualified or not. -
remove
Removes the given component, if present. -
replace
If the component specified by the given id exists in the path, the value will be replaced with the new value. -
indexOf
-
getPathComponent
-
getPathComponentOrElse
-
getPartsFor
Returns all of the sub parts for a specified id, or null if they don't exist. -
hasPathComponent
-
getParentPath
Description copied from interface:Path
Returns a path representing the element above the current path.- Specified by:
getParentPath
in interfacePath
-
toString
-
toStringSimple
Returns the path in a friendlier to read form, without component ids. -
isAncestorOf
Description copied from interface:Path
Returns whether the provided path is a child path of this one.- Specified by:
isAncestorOf
in interfacePath
-
hashCode
public int hashCode() -
equals
-
parse
Attempts to parse the string into an QualifiedPath. IOException is thrown on invalid path.- Throws:
IOException
-
parseSafe
Same as parse(), but catches exceptions and returns null on bad paths. -
parseSubParts
Returns at least one part for the root, with id. If the value contains sub parts, those will be returned as well. The root part will have the sub part count set on it already.
-