Class ConfigurationNode
- java.lang.Object
-
- 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
Fields Modifier and Type Field Description static java.lang.String_rcsidprotected java.util.Map<java.lang.String,java.lang.String>attributesprotected java.util.List<ConfigurationNode>childrenprotected booleanreadOnlyprotected java.lang.Stringtypeprotected java.lang.Stringvalue
-
Constructor Summary
Constructors Constructor Description ConfigurationNode(java.lang.String type)Constructor.ConfigurationNode(ConfigurationNode source)Duplication constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(int index, ConfigurationNode child)Add child at specified position.voidclearChildren()Clear children.protected static java.util.Map<java.lang.String,java.lang.String>cloneAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)protected ConfigurationNodecreateDuplicate(boolean readOnly)Create a duplicate of the current node.protected ConfigurationNodecreateNewNode()Make a new blank node identical in type and class to the current node.protected ConfigurationNodecreateNewNode(ConfigurationNode source)Make a new node that is a copy of the specified node.booleanequals(java.lang.Object o)Check if equalsConfigurationNodefindChild(int index)Get child n.intgetAttributeCount()Get the attribute count.java.util.Iterator<java.lang.String>getAttributes()Iterate over attributes.java.lang.StringgetAttributeValue(java.lang.String attribute)Get an attribute value.intgetChildCount()Get child count.java.lang.StringgetType()Get type.java.lang.StringgetValue()Get value.inthashCode()Calculate a hashcodevoidmakeReadOnly()Make this node (and its children) read-onlyvoidremoveChild(int index)Remove child n.voidsetAttribute(java.lang.String attribute, java.lang.String value)Set an attribute.voidsetValue(java.lang.String value)Set value.java.lang.StringtoString()Construct a human-readable string
-
-
-
Field Detail
-
_rcsid
public static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
children
protected java.util.List<ConfigurationNode> children
-
attributes
protected java.util.Map<java.lang.String,java.lang.String> 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:
getChildCountin interfaceIHierarchyParent- Returns:
- the count.
-
findChild
public ConfigurationNode findChild(int index)
Get child n.- Specified by:
findChildin interfaceIHierarchyParent- Parameters:
index- is the child number.- Returns:
- the child node.
-
removeChild
public void removeChild(int index)
Remove child n.- Specified by:
removeChildin interfaceIHierarchyParent- Parameters:
index- is the child to remove.
-
addChild
public void addChild(int index, ConfigurationNode child)Add child at specified position.- Specified by:
addChildin interfaceIHierarchyParent- Parameters:
index- is the position to add the child.child- is the child to add.
-
clearChildren
public void clearChildren()
Clear children.- Specified by:
clearChildrenin interfaceIHierarchyParent
-
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<java.lang.String> 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
Check if equals- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
Construct a human-readable string- Overrides:
toStringin classjava.lang.Object
-
cloneAttributes
protected static java.util.Map<java.lang.String,java.lang.String> cloneAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
-
-