org.springframework.extensions.config
Interface ConfigElement

All Superinterfaces:
Serializable
All Known Implementing Classes:
ConfigElementAdapter, GenericConfigElement, RemoteConfigElement, ServerConfigElement, WebFrameworkConfigElement, WebStudioConfigElement

public interface ConfigElement
extends Serializable

Definition of a configuration element

Author:
gavinc

Method Summary
 ConfigElement combine(ConfigElement configElement)
          Combines the given config element with this config element and returns a new instance containing the resulting combination.
 String getAttribute(String name)
          Gets the value of the attrbiute with the given name
 int getAttributeCount()
          Returns the number of attributes this config element has
 Map<String,String> getAttributes()
          Returns the list of attributes held by this config element
 ConfigElement getChild(String name)
          Returns a child config element of the given name
 int getChildCount()
          Returns the number of children this config element has
 List<ConfigElement> getChildren()
          Returns a list of children held by this ConfigElement
 List<ConfigElement> getChildren(String name)
          Returns a list of children held by this ConfigElement with the given name.
 String getChildValue(String name)
          Shortcut method to return a child config element value of the given name.
 String getName()
          Returns the name of this config element
 String getValue()
          Gets the value of this config element.
 boolean hasAttribute(String name)
          Determines whether the config element has the named attribute
 boolean hasChildren()
          Determines whether this config element has any children.
 

Method Detail

getName

String getName()
Returns the name of this config element

Returns:
Name of this config element

getAttribute

String getAttribute(String name)
Gets the value of the attrbiute with the given name

Parameters:
name - The name of the attrbiute to get the value for
Returns:
The value of the attrbiute or null if the attribute doesn't exist

getAttributes

Map<String,String> getAttributes()
Returns the list of attributes held by this config element

Returns:
The list of attrbiutes

hasAttribute

boolean hasAttribute(String name)
Determines whether the config element has the named attribute

Parameters:
name - Name of the attribute to check existence for
Returns:
true if it exists, false otherwise

getAttributeCount

int getAttributeCount()
Returns the number of attributes this config element has

Returns:
The number of attributes

getValue

String getValue()
Gets the value of this config element. If this config element has children then this method may return null

Returns:
Value of this config element or null if there is no value

getChild

ConfigElement getChild(String name)
Returns a child config element of the given name

Parameters:
name - The name of the config element to retrieve
Returns:
The ConfigElement or null if it does not exist

getChildValue

String getChildValue(String name)
Shortcut method to return a child config element value of the given name. Returns null as the value if the element does not exist.

Parameters:
name - The name of the config element to retrieve the value from.
Returns:
The ConfigElement value or null if it does not exist

getChildren

List<ConfigElement> getChildren(String name)
Returns a list of children held by this ConfigElement with the given name.

Parameters:
name - The name of the config element to retrieve
Returns:
The list of children.

getChildren

List<ConfigElement> getChildren()
Returns a list of children held by this ConfigElement

Returns:
The list of children.

hasChildren

boolean hasChildren()
Determines whether this config element has any children. It is more effecient to call this method rather than getChildren().size() as a collection is not created if it is not required

Returns:
true if it has children, false otherwise

getChildCount

int getChildCount()
Returns the number of children this config element has

Returns:
The number of children

combine

ConfigElement combine(ConfigElement 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.

Parameters:
configElement - The config element to combine into this one
Returns:
The combined ConfigElement


Copyright © 2009 SpringSource, Inc. All Rights Reserved.