org.codehaus.plexus.configuration.xml
Class ProtoXmlPlexusConfiguration

java.lang.Object
  extended by org.codehaus.plexus.configuration.xml.ProtoXmlPlexusConfiguration
All Implemented Interfaces:
PlexusConfiguration

public class ProtoXmlPlexusConfiguration
extends Object
implements PlexusConfiguration


Constructor Summary
ProtoXmlPlexusConfiguration(XmlPlexusConfiguration config)
           
 
Method Summary
 void addChild(PlexusConfiguration configuration)
          Adds a configuration under this configuration, which acts as a parent.
 PlexusConfiguration addChild(String name)
          Add a child element with a given name and return the newly created element.
 PlexusConfiguration addChild(String name, String value)
          Add a child element with a given name, and given value and return the newly created element.
 String getAttribute(String paramName)
          Returns the value of the named attribute.
 String getAttribute(String name, String defaultValue)
          Returns the value of the named attribute, or default if one cannot be found.
 String[] getAttributeNames()
          Returns an array of attribute names.
 PlexusConfiguration getChild(int i)
          Returns the child configuration at the given location.
 PlexusConfiguration getChild(String child)
          Returns the child configuration of the given name.
 PlexusConfiguration getChild(String child, boolean createChild)
          Returns the child configuration of the given name.
 int getChildCount()
          Returns the number of directly children under this configuration.
 PlexusConfiguration[] getChildren()
          Returns an array of all child configurations.
 PlexusConfiguration[] getChildren(String name)
          Returns an array of all child configurations with the given name.
 String getName()
          Returns the name of this configuration.
 String getValue()
          Returns the value of this configuration.
 String getValue(String defaultValue)
          Returns the value of this configuration, or default if one cannot be found.
 XmlPlexusConfiguration read()
           
 PlexusConfiguration setValue(String value)
          Set the value of a configuration element and return the PlexusConfiguration object so that further operations can be carried out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtoXmlPlexusConfiguration

public ProtoXmlPlexusConfiguration(XmlPlexusConfiguration config)
Method Detail

read

public XmlPlexusConfiguration read()

addChild

public void addChild(PlexusConfiguration configuration)
Description copied from interface: PlexusConfiguration
Adds a configuration under this configuration, which acts as a parent.

Specified by:
addChild in interface PlexusConfiguration
Parameters:
configuration - the child configuration to add

addChild

public PlexusConfiguration addChild(String name)
Description copied from interface: PlexusConfiguration
Add a child element with a given name and return the newly created element.

Specified by:
addChild in interface PlexusConfiguration
Returns:

addChild

public PlexusConfiguration addChild(String name,
                                    String value)
Description copied from interface: PlexusConfiguration
Add a child element with a given name, and given value and return the newly created element.

Specified by:
addChild in interface PlexusConfiguration
Returns:

getAttribute

public String getAttribute(String paramName)
                    throws PlexusConfigurationException
Description copied from interface: PlexusConfiguration
Returns the value of the named attribute.

Specified by:
getAttribute in interface PlexusConfiguration
Returns:
the value of the named attribute
Throws:
PlexusConfigurationException

getAttribute

public String getAttribute(String name,
                           String defaultValue)
Description copied from interface: PlexusConfiguration
Returns the value of the named attribute, or default if one cannot be found.

Specified by:
getAttribute in interface PlexusConfiguration
defaultValue - value to return if none is found
Returns:
the value of the named attribute

getAttributeNames

public String[] getAttributeNames()
Description copied from interface: PlexusConfiguration
Returns an array of attribute names.

Specified by:
getAttributeNames in interface PlexusConfiguration
Returns:
an array of attribute names

getChild

public PlexusConfiguration getChild(String child)
Description copied from interface: PlexusConfiguration
Returns the child configuration of the given name.

Specified by:
getChild in interface PlexusConfiguration
Parameters:
child - the name of the child to return
Returns:
the child configuration of the given name

getChild

public PlexusConfiguration getChild(int i)
Description copied from interface: PlexusConfiguration
Returns the child configuration at the given location.

Specified by:
getChild in interface PlexusConfiguration
Parameters:
i - the position of the child under this configuration
Returns:
the child configuration at the given location

getChild

public PlexusConfiguration getChild(String child,
                                    boolean createChild)
Description copied from interface: PlexusConfiguration
Returns the child configuration of the given name.

Specified by:
getChild in interface PlexusConfiguration
Parameters:
child - the name of the child to return
createChild - true if a new child should be create, if none found
Returns:
the child configuration of the given name, or new child if created

getChildCount

public int getChildCount()
Description copied from interface: PlexusConfiguration
Returns the number of directly children under this configuration.

Specified by:
getChildCount in interface PlexusConfiguration
Returns:
the number of directly children under this configuration.

getChildren

public PlexusConfiguration[] getChildren()
Description copied from interface: PlexusConfiguration
Returns an array of all child configurations.

Specified by:
getChildren in interface PlexusConfiguration
Returns:
an array of all child configurations

getChildren

public PlexusConfiguration[] getChildren(String name)
Description copied from interface: PlexusConfiguration
Returns an array of all child configurations with the given name.

Specified by:
getChildren in interface PlexusConfiguration
Parameters:
name - the name of the children configurations to return
Returns:
an array of all child configurations with the given name

getName

public String getName()
Description copied from interface: PlexusConfiguration
Returns the name of this configuration.

Specified by:
getName in interface PlexusConfiguration
Returns:
the name of this configuration

getValue

public String getValue()
                throws PlexusConfigurationException
Description copied from interface: PlexusConfiguration
Returns the value of this configuration.

Specified by:
getValue in interface PlexusConfiguration
Returns:
the value of this configuration
Throws:
PlexusConfigurationException

setValue

public PlexusConfiguration setValue(String value)
Description copied from interface: PlexusConfiguration
Set the value of a configuration element and return the PlexusConfiguration object so that further operations can be carried out.

Specified by:
setValue in interface PlexusConfiguration
Returns:

getValue

public String getValue(String defaultValue)
Description copied from interface: PlexusConfiguration
Returns the value of this configuration, or default if one cannot be found.

Specified by:
getValue in interface PlexusConfiguration
Parameters:
defaultValue - value to return if none is found
Returns:
the value of this configuration


Copyright © 2001-2008 Codehaus. All Rights Reserved.