org.apache.manifoldcf.core.interfaces
Class ConfigurationNode

java.lang.Object
  extended by org.apache.manifoldcf.core.interfaces.ConfigurationNode
All Implemented Interfaces:
IHierarchyParent
Direct Known Subclasses:
ConfigNode, SpecificationNode

public class ConfigurationNode
extends java.lang.Object
implements IHierarchyParent

This class represents a node in a configuration structure.


Field Summary
static java.lang.String _rcsid
           
protected  java.util.HashMap attributes
           
protected  java.util.ArrayList children
           
protected  boolean readOnly
           
protected  java.lang.String type
           
protected  java.lang.String value
           
 
Constructor Summary
ConfigurationNode(ConfigurationNode source)
          Duplication constructor.
ConfigurationNode(java.lang.String type)
          Constructor.
 
Method Summary
 void addChild(int index, ConfigurationNode child)
          Add child at specified position.
protected  ConfigurationNode createDuplicate(boolean readOnly)
          Create a duplicate of the current node.
protected  ConfigurationNode createNewNode()
          Make a new blank node identical in type and class to the current node.
protected  ConfigurationNode createNewNode(ConfigurationNode source)
          Make a new node that is a copy of the specified node.
 boolean equals(java.lang.Object o)
          Check if equals
 ConfigurationNode findChild(int index)
          Get child n.
 int getAttributeCount()
          Get the attribute count.
 java.util.Iterator getAttributes()
          Iterate over attributes.
 java.lang.String getAttributeValue(java.lang.String attribute)
          Get an attribute value.
 int getChildCount()
          Get child count.
 java.lang.String getType()
          Get type.
 java.lang.String getValue()
          Get value.
 int hashCode()
          Calculate a hashcode
 void makeReadOnly()
          Make this node (and its children) read-only
 void removeChild(int index)
          Remove child n.
 void setAttribute(java.lang.String attribute, java.lang.String value)
          Set an attribute.
 void setValue(java.lang.String value)
          Set value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_rcsid

public static final java.lang.String _rcsid
See Also:
Constant Field Values

children

protected java.util.ArrayList children

attributes

protected java.util.HashMap attributes

type

protected java.lang.String type

value

protected java.lang.String value

readOnly

protected boolean readOnly
Constructor Detail

ConfigurationNode

public ConfigurationNode(java.lang.String type)
Constructor.


ConfigurationNode

public ConfigurationNode(ConfigurationNode source)
Duplication constructor.

Method Detail

createNewNode

protected ConfigurationNode createNewNode()
Make a new blank node identical in type and class to the current node.

Returns:
the new node.

createNewNode

protected ConfigurationNode createNewNode(ConfigurationNode source)
Make a new node that is a copy of the specified node.


makeReadOnly

public void makeReadOnly()
Make this node (and its children) read-only


createDuplicate

protected ConfigurationNode createDuplicate(boolean readOnly)
Create a duplicate of the current node.

Returns:
the duplicate

getType

public java.lang.String getType()
Get type.

Returns:
the node type.

setValue

public void setValue(java.lang.String value)
Set value.

Parameters:
value - is the value to set.

getValue

public java.lang.String getValue()
Get value.

Returns:
the value.

getChildCount

public int getChildCount()
Get child count.

Specified by:
getChildCount in interface IHierarchyParent
Returns:
the count.

findChild

public ConfigurationNode findChild(int index)
Get child n.

Specified by:
findChild in interface IHierarchyParent
Parameters:
index - is the child number.
Returns:
the child node.

removeChild

public void removeChild(int index)
Remove child n.

Specified by:
removeChild in interface IHierarchyParent
Parameters:
index - is the child to remove.

addChild

public void addChild(int index,
                     ConfigurationNode child)
Add child at specified position.

Specified by:
addChild in interface IHierarchyParent
Parameters:
index - is the position to add the child.
child - is the child to add.

setAttribute

public void setAttribute(java.lang.String attribute,
                         java.lang.String value)
Set an attribute.

Parameters:
attribute - is the name of the attribute.
value - is the value of the attribute (null to remove it).

getAttributeCount

public int getAttributeCount()
Get the attribute count.

Returns:
the attribute count.

getAttributes

public java.util.Iterator getAttributes()
Iterate over attributes.

Returns:
the attribute iterator.

getAttributeValue

public java.lang.String getAttributeValue(java.lang.String attribute)
Get an attribute value.

Parameters:
attribute - is the name of the attribute.
Returns:
the value.

hashCode

public int hashCode()
Calculate a hashcode

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Check if equals

Overrides:
equals in class java.lang.Object