org.apache.slide.util.conf
Class ConfigurationImpl

java.lang.Object
  |
  +--org.apache.slide.util.conf.AbstractConfiguration
        |
        +--org.apache.slide.util.conf.ConfigurationImpl
All Implemented Interfaces:
Configuration

public class ConfigurationImpl
extends AbstractConfiguration

This is the default Configuration implementation.

Version:
CVS $Revision: 1.1 $ $Date: 2000/07/14 16:44:52 $
Author:
Federico Barbieri (Betaversion Productions), Stefano Mazzocchi (Apache Software Foundation), Pierpaolo Fumagalli (Apache Software Foundation, Exoffice Technologies)

Fields inherited from class org.apache.slide.util.conf.AbstractConfiguration
location
 
Constructor Summary
protected ConfigurationImpl()
          Create a new ConfigurationImpl instance.
protected ConfigurationImpl(java.lang.String name)
          Create a new ConfigurationImpl instance.
protected ConfigurationImpl(java.lang.String name, java.lang.String source, int line)
          Create a new ConfigurationImpl instance.
 
Method Summary
protected  java.lang.String addAttribute(java.lang.String name, java.lang.String value)
          Add an attribute to this configuration element, returning its old value or null.
 void addConfiguration(Configuration conf)
          Add a child Configuration to this configuration element.
protected  void appendValueData(java.lang.String value)
          Append data to the value of this configuration element.
 java.lang.String getAttribute(java.lang.String name)
          Returns the value of the attribute specified by its name as a String.
 Configuration getConfiguration(java.lang.String name)
          Return the first Configuration object child of this associated with the given name or null.
 java.util.Enumeration getConfigurations(java.lang.String name)
          Return an Enumeration of Configuration objects children of this associated with the given name.
 java.lang.String getName()
          Returns the name of this configuration element.
 java.lang.String getValue()
          Returns the value of the configuration element as a String.
 
Methods inherited from class org.apache.slide.util.conf.AbstractConfiguration
getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsFloat, getAttributeAsFloat, getAttributeAsInt, getAttributeAsInt, getAttributeAsLong, getAttributeAsLong, getLocation, getValue, getValueAsBoolean, getValueAsBoolean, getValueAsFloat, getValueAsFloat, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationImpl

protected ConfigurationImpl()
Create a new ConfigurationImpl instance.

ConfigurationImpl

protected ConfigurationImpl(java.lang.String name)
Create a new ConfigurationImpl instance.

ConfigurationImpl

protected ConfigurationImpl(java.lang.String name,
                            java.lang.String source,
                            int line)
Create a new ConfigurationImpl instance.
Method Detail

getName

public java.lang.String getName()
Returns the name of this configuration element.

getValue

public java.lang.String getValue()
                          throws ConfigurationException
Returns the value of the configuration element as a String.
Throws:
ConfigurationException - If the value is not present.

getAttribute

public java.lang.String getAttribute(java.lang.String name)
                              throws ConfigurationException
Returns the value of the attribute specified by its name as a String.
Throws:
ConfigurationException - If the attribute is not present.

getConfiguration

public Configuration getConfiguration(java.lang.String name)
Return the first Configuration object child of this associated with the given name or null.
Overrides:
getConfiguration in class AbstractConfiguration
Parameters:
name - The name of the required child Configuration.

getConfigurations

public java.util.Enumeration getConfigurations(java.lang.String name)
Return an Enumeration of Configuration objects children of this associated with the given name.
The returned Enumeration may be empty.
Parameters:
name - The name of the required children Configuration.

appendValueData

protected void appendValueData(java.lang.String value)
Append data to the value of this configuration element.

addAttribute

protected java.lang.String addAttribute(java.lang.String name,
                                        java.lang.String value)
Add an attribute to this configuration element, returning its old value or null.

addConfiguration

public void addConfiguration(Configuration conf)
Add a child Configuration to this configuration element.