public class DefaultPlexusConfiguration extends Object implements PlexusConfiguration
| Modifier | Constructor and Description |
|---|---|
protected |
DefaultPlexusConfiguration() |
protected |
DefaultPlexusConfiguration(String name) |
protected |
DefaultPlexusConfiguration(String name,
String value) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(PlexusConfiguration child)
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 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.
|
void |
setAttribute(String name,
String value)
Sets an attribute on this configuration.
|
void |
setName(String name)
Sets the name of this configuration.
|
void |
setValue(String val)
Set the value of a configuration element.
|
PlexusConfiguration |
setValueAndGetSelf(String val)
Set the value of a configuration element and return the PlexusConfiguration object
so that further operations can be carried out.
|
protected DefaultPlexusConfiguration()
protected DefaultPlexusConfiguration(String name)
public String getName()
PlexusConfigurationgetName in interface PlexusConfigurationpublic void setName(String name)
PlexusConfigurationsetName in interface PlexusConfigurationpublic String getValue()
PlexusConfigurationgetValue in interface PlexusConfigurationpublic String getValue(String defaultValue)
PlexusConfigurationgetValue in interface PlexusConfigurationdefaultValue - value to return if none is foundpublic void setValue(String val)
PlexusConfigurationsetValue in interface PlexusConfigurationpublic PlexusConfiguration setValueAndGetSelf(String val)
PlexusConfigurationsetValueAndGetSelf in interface PlexusConfigurationpublic void setAttribute(String name, String value)
PlexusConfigurationsetAttribute in interface PlexusConfigurationpublic String getAttribute(String name)
PlexusConfigurationgetAttribute in interface PlexusConfigurationpublic String getAttribute(String name, String defaultValue)
PlexusConfigurationgetAttribute in interface PlexusConfigurationdefaultValue - value to return if none is foundpublic String[] getAttributeNames()
PlexusConfigurationgetAttributeNames in interface PlexusConfigurationpublic PlexusConfiguration getChild(String name)
PlexusConfigurationgetChild in interface PlexusConfigurationname - the name of the child to returnpublic PlexusConfiguration getChild(int i)
PlexusConfigurationgetChild in interface PlexusConfigurationi - the position of the child under this configurationpublic PlexusConfiguration getChild(String name, boolean createChild)
PlexusConfigurationgetChild in interface PlexusConfigurationname - the name of the child to returncreateChild - true if a new child should be create, if none foundpublic PlexusConfiguration[] getChildren()
PlexusConfigurationgetChildren in interface PlexusConfigurationpublic PlexusConfiguration[] getChildren(String name)
PlexusConfigurationgetChildren in interface PlexusConfigurationname - the name of the children configurations to returnpublic void addChild(PlexusConfiguration child)
PlexusConfigurationaddChild in interface PlexusConfigurationchild - the child configuration to addpublic PlexusConfiguration addChild(String name)
PlexusConfigurationaddChild in interface PlexusConfigurationpublic PlexusConfiguration addChild(String name, String value)
PlexusConfigurationaddChild in interface PlexusConfigurationpublic int getChildCount()
PlexusConfigurationgetChildCount in interface PlexusConfigurationCopyright © 2001–2016 Codehaus Plexus. All rights reserved.