org.sapia.regis
Interface Node

All Known Subinterfaces:
RWNode
All Known Implementing Classes:
CacheNode, LazyNode, NodeImpl, RemoteNode

public interface Node

A instance of this class holds configuration properties (consisting of name/value pairs). It has a composite, recursive structure: it can potentially contain other nodes, and so on.

In addition, an instance of this class supports the concepts of links and includes.

Author:
yduchesne

Field Summary
static String ROOT_NAME
           
 
Method Summary
 Path getAbsolutePath()
           
 Node getChild(Path path)
           
 Node getChild(String name)
           
 Collection getChildren()
           
 Collection getChildrenNames()
           
 Collection getIncludes()
           
 Collection getLinks(boolean prepended)
           
 String getName()
           
 Collection getNodes(Query query)
           
 Node getParent()
           
 Map getProperties()
          Returns this instance's properties.
 Map getProperties(Map values)
           
 Property getProperty(String key)
           
 Collection getPropertyKeys()
           
 String getType()
           
 boolean isInheritsParent()
           
 boolean isRoot()
           
 long lastModifChecksum()
          This method returns a checksum based on the last modification time of this instance and of this parents and links, if any.
 Property renderProperty(String key)
          This method returns the property corresponding to the given key.
 Property renderProperty(String key, Map values)
           
 

Field Detail

ROOT_NAME

static final String ROOT_NAME
See Also:
Constant Field Values
Method Detail

getName

String getName()
Returns:
this instance's name.

getChildrenNames

Collection getChildrenNames()
Returns:
the Collection of names of this instance's child nodes.

getType

String getType()
Returns:
the type of this node.

getAbsolutePath

Path getAbsolutePath()
Returns:
this instance's absolute Path.

lastModifChecksum

long lastModifChecksum()
This method returns a checksum based on the last modification time of this instance and of this parents and links, if any.

Returns:
a long corresponding to a checksum.

getParent

Node getParent()
Returns:
this instance's parent - or null if this instance is the root.

isRoot

boolean isRoot()
Returns:
true if this instance is the root.

isInheritsParent

boolean isInheritsParent()
Returns:
true if this instance inherits its parent node (if any).

getLinks

Collection getLinks(boolean prepended)
Parameters:
prepended - if true, returns this instance's prepended links, else, returns this instance's appended links.
Returns:
a Collection of Nodes.

getIncludes

Collection getIncludes()
Returns:
the Collection of Nodes that have been included in this instance.

getProperty

Property getProperty(String key)
Parameters:
key - a property key.
Returns:
a Property corresponding to the given key (if no corresponding property corresponds to the given key, the returned property's isNull() method returns true).

renderProperty

Property renderProperty(String key)
This method returns the property corresponding to the given key. If the property's value holds a variable or many variables (in the ${varName} notation), these variables are rendered prior to the property being returned - the client application will thus not "see" the variables.

Variable values are search as follows:

If any variable could not be rendered, then it is left in its original notation.

Parameters:
key - a property key.
Returns:
a Property corresponding to the given key (if no corresponding property corresponds to the given key, the returned property's isNull() method returns true).

renderProperty

Property renderProperty(String key,
                        Map values)
Parameters:
values - a Map of properties (name/value pairs) to be used internally by this method's interpolation logic.
See Also:
renderProperty(String)

getPropertyKeys

Collection getPropertyKeys()
Returns:
the Collection of keys of the properties held by this instance.

getProperties

Map getProperties()
Returns this instance's properties. Variable interpolation is performed prior to returning the properties.

Returns:
the Map holding a copy of the configuration properties held by this instance.

getProperties

Map getProperties(Map values)
Parameters:
values - a Map of properties (name/value pairs) to be used internally by this method's interpolation logic.
See Also:
getProperties()

getChild

Node getChild(String name)
Parameters:
name - the name of the child to acquire.
Returns:
the child Node, or null if no such child exists.

getChild

Node getChild(Path path)
Parameters:
path - the Path corresponding to the child to create.
Returns:
the child Node, or null if no such child exists.

getChildren

Collection getChildren()
Returns:
the Collection of child Nodes of this instance.

getNodes

Collection getNodes(Query query)
Parameters:
query - a Query
Returns:
a Collection of Nodes that match the given query.


Copyright © 2006 Sapia Open Community, Inc. All Rights Reserved.