|
Style Intelligence v12.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectinetsoft.uql.path.XNodePath
public class XNodePath
A node path is used to perform tree selections. It can be used to select a subtree from a xnode tree. The selection can be done using only node path, or mixed with conditions at any sequence node. A simple node path is the node name concatenated together from the root of the tree, separated by dots:
employee.nameA condition can be attached to a node:employee[state = 'NJ'].name
| Constructor Summary | |
|---|---|
XNodePath()
Create an empty node path. |
|
| Method Summary | |
|---|---|
void |
add(PathNode node)
Add a node to the node path. |
void |
add(String name)
Add a node to the path. |
void |
add(String name,
ConditionExpression cond)
Add a node to the path with an additional condition to select nodes from the sequence. |
void |
add(String name,
String cond)
Add a node to the path with an additional condition to select nodes from the sequence. |
Object |
clone()
Returns a clone of this object. |
PathNode |
find(XTypeNode root,
XTypeNode node)
Check if the node specified by the type is on the node path. |
String |
getPath(PathNode node)
This get the path of the nodes. |
PathNode |
getPathNode(int idx)
Get the specified node. |
int |
getPathNodeCount()
Get the number of nodes from the path. |
String[] |
getVariables()
Get the names of all variables used in the conditions in the path. |
static XNodePath |
parse(String path)
Parse a node path string and create a node path object. |
static XNodePath |
parseSimplePath(String path)
Parse a simple path that is a concatenation of node names without any condition expression. |
void |
parseXML(Element root)
Parse the XML element that contains information of this node path. |
XNode |
select(XNode root,
VariableTable vars)
Apply the path to the tree, and return selected nodes from the tree. |
void |
setPathNode(int idx,
PathNode node)
Set the node at the specified index. |
String |
toString()
|
void |
writeXML(PrintWriter writer)
Write node path in XML representation. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public XNodePath()
| Method Detail |
|---|
public static XNodePath parse(String path)
throws ParseException
ParseExceptionpublic static XNodePath parseSimplePath(String path)
public XNode select(XNode root,
VariableTable vars)
throws Exception
root - tree root.vars - query variables.
Exceptionpublic String[] getVariables()
public PathNode find(XTypeNode root,
XTypeNode node)
public int getPathNodeCount()
public PathNode getPathNode(int idx)
idx - node index.
public void setPathNode(int idx,
PathNode node)
idx - node index.node - new path node.public void add(String name)
public void add(String name,
String cond)
throws ParseException
ParseException
public void add(String name,
ConditionExpression cond)
public void add(PathNode node)
public String getPath(PathNode node)
node - the path node this path should include. Nodes following
the node is not added to the path. If the node is null, all nodes
are included.public String toString()
toString in class Objectpublic void writeXML(PrintWriter writer)
public void parseXML(Element root)
throws Exception
Exceptionpublic Object clone()
clone in class Object
|
Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||