org.codehaus.plexus.configuration.xml
Class XmlPlexusConfiguration

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

public class XmlPlexusConfiguration
extends Object
implements PlexusConfiguration

Version:
$Id: XmlPlexusConfiguration.java 4779 2006-11-23 04:09:31Z jvanzyl $

Constructor Summary
XmlPlexusConfiguration(String name)
           
XmlPlexusConfiguration(org.codehaus.plexus.util.xml.Xpp3Dom dom)
           
 
Method Summary
 void addAllChildren(PlexusConfiguration other)
           
 void addChild(PlexusConfiguration configuration)
          Adds a configuration under this configuration, which acts as a parent.
 String getAttribute(String name)
          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 name)
          Returns the child configuration of the given name.
 PlexusConfiguration getChild(String name, 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.
 org.codehaus.plexus.util.xml.Xpp3Dom getXpp3Dom()
           
 void setAttribute(String name, String value)
           
 void setValue(String value)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XmlPlexusConfiguration

public XmlPlexusConfiguration(String name)

XmlPlexusConfiguration

public XmlPlexusConfiguration(org.codehaus.plexus.util.xml.Xpp3Dom dom)
Method Detail

getXpp3Dom

public org.codehaus.plexus.util.xml.Xpp3Dom getXpp3Dom()

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()
Description copied from interface: PlexusConfiguration
Returns the value of this configuration.

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

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

setValue

public void setValue(String value)

setAttribute

public void setAttribute(String name,
                         String value)

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

getAttribute

public String getAttribute(String name)
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

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 name)
Description copied from interface: PlexusConfiguration
Returns the child configuration of the given name.

Specified by:
getChild in interface PlexusConfiguration
Parameters:
name - 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 name,
                                    boolean createChild)
Description copied from interface: PlexusConfiguration
Returns the child configuration of the given name.

Specified by:
getChild in interface PlexusConfiguration
Parameters:
name - 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

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

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

addAllChildren

public void addAllChildren(PlexusConfiguration other)

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.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2007 Codehaus. All Rights Reserved.