Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

com.cosylab.cdb.jdal.DALNode Class Reference

List of all members.

Public Member Functions

 DALNode (String name, DALNode parent)
String list (String path)
String getCurl ()
void print (int level)
DALNode getCurlNode ()
DALNode[] getChilds ()
boolean isSimple ()
boolean hasXmlChild ()

Static Public Member Functions

static DALNode getRoot (String filePath)

Protected Member Functions

DALNode findNode (String path)
void loadNodes (String filePath)
void addNode (String nodePath)
DALNode getNode (String nodeName)
void getNodes (List list)

Protected Attributes

String name
ArrayList childs
DALNode parent

Constructor & Destructor Documentation

com.cosylab.cdb.jdal.DALNode.DALNode ( String  name,
DALNode  parent 
)

Constructs this object.

Parameters:
name The name of this node
parent parent node for this node

Referenced by com.cosylab.cdb.jdal.DALNode.addNode(), and com.cosylab.cdb.jdal.DALNode.getRoot().


Member Function Documentation

void com.cosylab.cdb.jdal.DALNode.addNode ( String  nodePath  )  [protected]

Adds a child node to this node at the proper place given by nodePath The nodePath can be delimited by File.separatorChar.

Parameters:
nodePath The path of the node i.e. MACI/Managers/Manager/Manager.xml

References com.cosylab.cdb.jdal.DALNode.addNode(), com.cosylab.cdb.jdal.DALNode.childs, com.cosylab.cdb.jdal.DALNode.DALNode(), and com.cosylab.cdb.jdal.DALNode.getNode().

Referenced by com.cosylab.cdb.jdal.DALNode.addNode(), and com.cosylab.cdb.jdal.DALNode.loadNodes().

DALNode com.cosylab.cdb.jdal.DALNode.findNode ( String  path  )  [protected]

Returns the node for the given path or null if the path does not exist under this tree.

Parameters:
path The path to find i.e. MACI/Managers
Returns:
The child node for path or null if it doesn't exist

References com.cosylab.cdb.jdal.DALNode.findNode(), and com.cosylab.cdb.jdal.DALNode.getNode().

Referenced by com.cosylab.cdb.jdal.DALNode.findNode(), com.cosylab.cdb.jdal.DALNode.hasXmlChild(), com.cosylab.cdb.jdal.DALNode.list(), and com.cosylab.cdb.jdal.DALImpl.loadRecords().

DALNode [] com.cosylab.cdb.jdal.DALNode.getChilds (  ) 
String com.cosylab.cdb.jdal.DALNode.getCurl (  ) 
DALNode com.cosylab.cdb.jdal.DALNode.getCurlNode (  ) 
DALNode com.cosylab.cdb.jdal.DALNode.getNode ( String  nodeName  )  [protected]

Returns a sibling child node with given name

Parameters:
nodeName The name of child node
Returns:
The child node or null it it doesn't exists

References com.cosylab.cdb.jdal.DALNode.childs, and com.cosylab.cdb.jdal.DALNode.name.

Referenced by com.cosylab.cdb.jdal.DALNode.addNode(), and com.cosylab.cdb.jdal.DALNode.findNode().

void com.cosylab.cdb.jdal.DALNode.getNodes ( List  list  )  [protected]

Fill given list with nodes

Parameters:
nodeName The name of child node
Returns:
The child node or null it it doesn't exists

References com.cosylab.cdb.jdal.DALNode.childs, com.cosylab.cdb.jdal.DALNode.getCurl(), and com.cosylab.cdb.jdal.DALNode.getNodes().

Referenced by com.cosylab.cdb.jdal.DALNode.getNodes().

static DALNode com.cosylab.cdb.jdal.DALNode.getRoot ( String  filePath  )  [static]

Constructs a root node which holds the hierarchy of all valid curls given by path filePath

Parameters:
filePath the path where scan begins this is ususaly the DAL root path
Returns:
an instance of DALNode that has all hierarchy inside itself.

References com.cosylab.cdb.jdal.DALNode.DALNode(), and com.cosylab.cdb.jdal.DALNode.loadNodes().

Referenced by com.cosylab.cdb.jdal.DALImpl.clear_cache_all(), com.cosylab.cdb.jdal.DALImpl.list_daos(), com.cosylab.cdb.jdal.DALImpl.list_nodes(), and com.cosylab.cdb.jdal.DALImpl.loadRecords().

boolean com.cosylab.cdb.jdal.DALNode.hasXmlChild (  ) 
boolean com.cosylab.cdb.jdal.DALNode.isSimple (  ) 

Returns true if this node is without any hierarchy - just plain node

Returns:

References com.cosylab.cdb.jdal.DALNode.childs.

Referenced by com.cosylab.cdb.jdal.DALImpl.loadRecords().

String com.cosylab.cdb.jdal.DALNode.list ( String  path  ) 

Returns a string that holds child names of the given path

Parameters:
path The path where to start i.e. MACI/Managers
Returns:
a string of the child names delimited with a space

References com.cosylab.cdb.jdal.DALNode.childs, com.cosylab.cdb.jdal.DALNode.findNode(), and com.cosylab.cdb.jdal.DALNode.name.

Referenced by com.cosylab.cdb.jdal.DALNode.getChilds(), com.cosylab.cdb.jdal.DALImpl.list_daos(), and com.cosylab.cdb.jdal.DALImpl.list_nodes().

void com.cosylab.cdb.jdal.DALNode.loadNodes ( String  filePath  )  [protected]

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.

Parameters:
filePath The path where to start scan i.e. $ACS_CDB

References com.cosylab.cdb.jdal.DALNode.addNode(), and com.cosylab.cdb.jdal.DALNode.name.

Referenced by com.cosylab.cdb.jdal.DALNode.getRoot().

void com.cosylab.cdb.jdal.DALNode.print ( int  level  ) 

Prints the hierarchy on System.out indenting child nodes This function is used for debuging purposes.

Parameters:
level The indentation level which will be recursevly increased

References com.cosylab.cdb.jdal.DALNode.childs, com.cosylab.cdb.jdal.DALNode.name, and com.cosylab.cdb.jdal.DALNode.print().

Referenced by com.cosylab.cdb.jdal.DALNode.print().


Member Data Documentation

ArrayList com.cosylab.cdb.jdal.DALNode.childs [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties