public interface Node
Modifier and Type | Field and Description |
---|---|
static String |
PATH_SEPARATOR |
static String |
ROOT_PATH |
Modifier and Type | Method and Description |
---|---|
String |
getName()
Returns the name of the node.
|
Node |
getNode(String relativePath)
Retrieves a node based on a relative path to the current node.
|
Collection<Node> |
getNodes()
Get all the direct child nodes.
|
Node |
getParent()
Returns the parent node.
|
String |
getPath()
Returns the path of the node.
|
Map<String,Object> |
getProperties()
Returns a Map of all the property names and their values.
|
<T> T |
getTypedProperty(String key)
Retrieve a property of this Node.
|
boolean |
hasNode(String relativePath)
Checks to see if a node exists at the current path.
|
boolean |
hasNodes()
Checks if the current node has any child nodes.
|
boolean |
hasProperty(String property)
Checks to see if the current node has a property set.
|
static final String PATH_SEPARATOR
static final String ROOT_PATH
String getName()
Node getNode(String relativePath) throws PathNotFoundException
node2.getNode("node3/node4")
node2.getNode("../nodeX/nodeY")
node2.getNode("node3/../nodeX")
node2.getParent().getNode("nodeX/nodeY")
relativePath
- The path to the desired node, relative to the current
nodes location.PathNotFoundException
- Thrown if any element of the requested
relative path is not valid.Collection<Node> getNodes()
Node getParent()
String getPath()
Map<String,Object> getProperties()
<T> T getTypedProperty(String key)
ClassCastException
.T
- The type of property being retrieved.key
- The name of the property on the node.boolean hasNode(String relativePath)
relativePath
- The path to the node relative to the current node.boolean hasNodes()
boolean hasProperty(String property)
property
- The name of the property for this node.Copyright © 2013, Oracle and/or its affiliates. All rights reserved.