org.codehaus.plexus.configuration
Interface PlexusConfiguration
public interface PlexusConfiguration
A configuration data hierarchy for configuring aspects of plexus. For
example, to populate a ComponentDescriptor. Implementation of
PlexusConfiguration may be populated by any means, for example, by XML file.
addChild
public void addChild(PlexusConfiguration configuration)
Adds a configuration under this configuration, which acts as
a parent.
configuration
- the child configuration to add
getAttribute
public String getAttribute(String paramName)
throws PlexusConfigurationException
Returns the value of the named attribute.
- the value of the named attribute
getAttribute
public String getAttribute(String name,
String defaultValue)
Returns the value of the named attribute, or default if one cannot be
found.
defaultValue
- value to return if none is found
- the value of the named attribute
getAttributeNames
public String[] getAttributeNames()
Returns an array of attribute names.
- an array of attribute names
getChild
public PlexusConfiguration getChild(String child)
Returns the child configuration of the given name.
child
- the name of the child to return
- the child configuration of the given name
getChild
public PlexusConfiguration getChild(String child,
boolean createChild)
Returns the child configuration of the given name.
child
- the name of the child to returncreateChild
- true if a new child should be create, if none found
- the child configuration of the given name, or new child if
created
getChild
public PlexusConfiguration getChild(int i)
Returns the child configuration at the given location.
i
- the position of the child under this configuration
- the child configuration at the given location
getChildCount
public int getChildCount()
Returns the number of directly children under this configuration.
- the number of directly children under this configuration.
getChildren
public PlexusConfiguration[] getChildren()
Returns an array of all child configurations.
- an array of all child configurations
getChildren
public PlexusConfiguration[] getChildren(String name)
Returns an array of all child configurations with the given name.
name
- the name of the children configurations to return
- an array of all child configurations with the given name
getName
public String getName()
Returns the name of this configuration.
- the name of this configuration
getValue
public String getValue()
throws PlexusConfigurationException
Returns the value of this configuration.
- the value of this configuration
getValue
public String getValue(String defaultValue)
Returns the value of this configuration, or default if one cannot be
found.
defaultValue
- value to return if none is found
- the value of this configuration