org.springframework.extensions.config.element
Class GenericConfigElement

java.lang.Object
  extended by org.springframework.extensions.config.element.ConfigElementAdapter
      extended by org.springframework.extensions.config.element.GenericConfigElement
All Implemented Interfaces:
Serializable, ConfigElement

public class GenericConfigElement
extends ConfigElementAdapter

Implementation of a generic configuration element. This class can handle the representation of any config element in a generic manner.

Author:
gavinc
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.springframework.extensions.config.element.ConfigElementAdapter
attributes, children, name, value
 
Constructor Summary
GenericConfigElement(String name)
          Default constructor
 
Method Summary
 void addAttribute(String name, String value)
          Adds the attribute with the given name and value
 void addChild(ConfigElement configElement)
          Adds the given config element as a child of this element
 ConfigElement combine(ConfigElement configElement)
          Combines the given config element with this config element and returns a new instance containing the resulting combination.
 
Methods inherited from class org.springframework.extensions.config.element.ConfigElementAdapter
getAttribute, getAttributeCount, getAttributes, getChild, getChildCount, getChildren, getChildren, getChildrenMap, getChildValue, getName, getValue, hasAttribute, hasChildren, setValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GenericConfigElement

public GenericConfigElement(String name)
Default constructor

Parameters:
name - Name of the config element
Method Detail

combine

public ConfigElement combine(ConfigElement configElement)
Description copied from interface: ConfigElement
Combines the given config element with this config element and returns a new instance containing the resulting combination. The combination of the two objects MUST NOT change this instance.

Specified by:
combine in interface ConfigElement
Specified by:
combine in class ConfigElementAdapter
Parameters:
configElement - The config element to combine into this one
Returns:
The combined ConfigElement

addAttribute

public void addAttribute(String name,
                         String value)
Adds the attribute with the given name and value

Parameters:
name - Name of the attribute
value - Value of the attribute

addChild

public void addChild(ConfigElement configElement)
Adds the given config element as a child of this element

Parameters:
configElement - The child config element


Copyright © 2009 SpringSource, Inc. All Rights Reserved.