Package com.ibm.fhir.path
Class FHIRPathTree
- java.lang.Object
-
- com.ibm.fhir.path.FHIRPathTree
-
public class FHIRPathTree extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FHIRPathNode
getNode(java.lang.String path)
Get the node at the location given by the path parameterFHIRPathNode
getParent(FHIRPathNode node)
Get the parent of the node parameterFHIRPathNode
getRoot()
The root node of this FHIRPathTreeFHIRPathNode
getSibling(FHIRPathNode node, java.lang.String name)
Get the first sibling of the node parameter with the given namejava.util.Collection<FHIRPathNode>
getSiblings(FHIRPathNode node)
Get the siblings of the node parameterjava.util.Collection<FHIRPathNode>
getSiblings(FHIRPathNode node, java.lang.String name)
Get the siblings of the node parameter with the given namestatic FHIRPathTree
tree(Resource resource)
Static factory method for creating FHIRPathTree instances from aResource
static FHIRPathTree
tree(Element element)
Static factory method for creating FHIRPathTree instances from anElement
-
-
-
Method Detail
-
getRoot
public FHIRPathNode getRoot()
The root node of this FHIRPathTree- Returns:
- the root node of this FHIRPathTree
-
getNode
public FHIRPathNode getNode(java.lang.String path)
Get the node at the location given by the path parameter- Parameters:
path
- the location of the node in the tree- Returns:
- the node at the location given by the path parameter if exists, otherwise null
-
getParent
public FHIRPathNode getParent(FHIRPathNode node)
Get the parent of the node parameter- Parameters:
node
- the node- Returns:
- the parent of the node parameter if exists, otherwise null
-
getSiblings
public java.util.Collection<FHIRPathNode> getSiblings(FHIRPathNode node)
Get the siblings of the node parameter- Parameters:
node
- the node- Returns:
- the siblings of the node parameter if exists, otherwise empty collection
-
getSiblings
public java.util.Collection<FHIRPathNode> getSiblings(FHIRPathNode node, java.lang.String name)
Get the siblings of the node parameter with the given name- Parameters:
node
- the nodename
- the name- Returns:
- the siblings of the node parameter with the given name if exists, otherwise empty collection
-
getSibling
public FHIRPathNode getSibling(FHIRPathNode node, java.lang.String name)
Get the first sibling of the node parameter with the given name- Parameters:
node
- the nodename
- the name- Returns:
- the first sibling of the node parameter with the given name if exists, otherwise null
-
tree
public static FHIRPathTree tree(Resource resource)
Static factory method for creating FHIRPathTree instances from aResource
- Parameters:
resource
- the resource- Returns:
- a new FHIRPathTree instance
-
tree
public static FHIRPathTree tree(Element element)
Static factory method for creating FHIRPathTree instances from anElement
- Parameters:
element
- the element- Returns:
- a new FHIRPathTree instance
-
-