org.oddjob.arooa.parsing
Class AbstractConfigurationNode

java.lang.Object
  extended by org.oddjob.arooa.parsing.AbstractConfigurationNode
All Implemented Interfaces:
ArooaConfiguration, ConfigurationNode
Direct Known Subclasses:
XMLConfigurationNode

public abstract class AbstractConfigurationNode
extends Object
implements ConfigurationNode

Implementation of common ConfigurationNode functionality.

Author:
rob

Nested Class Summary
protected static class AbstractConfigurationNode.ChainingConfigurationHandle
          This ConfigurationHandle survives the replacement of this ConfigurationNode which is what happens in order to save changes.
 
Constructor Summary
AbstractConfigurationNode()
           
 
Method Summary
 void addNodeListener(ConfigurationNodeListener listener)
          Add a RuntimeNodeListener.
 ConfigurationNode[] children()
           
 int indexOf(ConfigurationNode child)
          Get the index of a child RuntimeNode.
 int insertChild(ConfigurationNode child)
          Insert a child in the parse Tree.
 void removeChild(int index)
          Remove a child.
 void removeNodeListener(ConfigurationNodeListener listener)
          Remove a RuntimeNodeListener.
 void setInsertPosition(int insertAt)
          Set the position for the next inserted node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.oddjob.arooa.runtime.ConfigurationNode
addText, getContext
 
Methods inherited from interface org.oddjob.arooa.ArooaConfiguration
parse
 

Constructor Detail

AbstractConfigurationNode

public AbstractConfigurationNode()
Method Detail

addNodeListener

public void addNodeListener(ConfigurationNodeListener listener)
Description copied from interface: ConfigurationNode
Add a RuntimeNodeListener.

Specified by:
addNodeListener in interface ConfigurationNode

setInsertPosition

public void setInsertPosition(int insertAt)
Description copied from interface: ConfigurationNode
Set the position for the next inserted node.

Specified by:
setInsertPosition in interface ConfigurationNode
Parameters:
insertAt - The position.

removeNodeListener

public void removeNodeListener(ConfigurationNodeListener listener)
Description copied from interface: ConfigurationNode
Remove a RuntimeNodeListener.

Specified by:
removeNodeListener in interface ConfigurationNode

insertChild

public int insertChild(ConfigurationNode child)
Description copied from interface: ConfigurationNode
Insert a child in the parse Tree.

Specified by:
insertChild in interface ConfigurationNode
Parameters:
child - The child. Must not be null.
Returns:
The insert position.

removeChild

public void removeChild(int index)
Description copied from interface: ConfigurationNode
Remove a child.

Specified by:
removeChild in interface ConfigurationNode
Parameters:
index - The index at which to remove the child.

indexOf

public int indexOf(ConfigurationNode child)
Description copied from interface: ConfigurationNode
Get the index of a child RuntimeNode. This is required for lists who's indexes may change as nodes are inserted and deleted.

Specified by:
indexOf in interface ConfigurationNode
Parameters:
child - The child node whose index is to be determined.
Returns:
The index, or -1 if the node is not a child.

children

public ConfigurationNode[] children()