public class DALNode
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.util.ArrayList |
childs |
protected java.lang.String |
name |
protected DALNode |
parent |
| Constructor and Description |
|---|
DALNode(java.lang.String name,
DALNode parent)
Constructs this object.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addNode(java.lang.String nodePath)
Adds a child node to this node at the proper place given by
nodePath |
protected DALNode |
findNode(java.lang.String path)
Returns the node for the given path or
null if the
path does not exist under this tree. |
DALNode[] |
getChilds() |
java.lang.String |
getCurl() |
DALNode |
getCurlNode() |
protected DALNode |
getNode(java.lang.String nodeName)
Returns a sibling child node with given name
|
protected void |
getNodes(java.util.List list)
Fill given list with nodes
|
static DALNode |
getRoot(java.lang.String filePath)
Constructs a root node which holds the hierarchy of all
valid curls given by path
filePath |
boolean |
hasXmlChild() |
boolean |
isSimple()
Returns true if this node is without any hierarchy - just plain node
|
java.lang.String |
list(java.lang.String path)
Returns a string that holds child names of the given path
|
protected void |
loadNodes(java.lang.String filePath)
Scans the path given by
filePath and creates nodes
as childs for this node for all XML files that has name as its
parent directory. |
void |
print(int level)
Prints the hierarchy on System.out indenting child nodes
This function is used for debuging purposes.
|
protected java.lang.String name
protected java.util.ArrayList childs
protected DALNode parent
public DALNode(java.lang.String name,
DALNode parent)
name - The name of this nodeparent - parent node for this nodepublic static DALNode getRoot(java.lang.String filePath)
filePathfilePath - the path where scan begins this is ususaly the DAL root pathpublic java.lang.String list(java.lang.String path)
path - The path where to start i.e. MACI/Managersprotected DALNode findNode(java.lang.String path)
null if the
path does not exist under this tree.path - The path to find i.e. MACI/Managersnull if it doesn't existprotected void loadNodes(java.lang.String filePath)
filePath and creates nodes
as childs for this node for all XML files that has name as its
parent directory.filePath - The path where to start scan i.e. $ACS_CDBprotected void addNode(java.lang.String nodePath)
nodePath
The nodePath can be delimited by File.separatorChar.nodePath - The path of the node i.e. MACI/Managers/Manager/Manager.xmlprotected DALNode getNode(java.lang.String nodeName)
nodeName - The name of child nodenull it it doesn't existsprotected void getNodes(java.util.List list)
nodeName - The name of child nodepublic java.lang.String getCurl()
public void print(int level)
level - The indentation level which will be recursevly increasedpublic DALNode getCurlNode()
public DALNode[] getChilds()
public boolean isSimple()
public boolean hasXmlChild()