public class DefaultPlexusConfiguration extends java.lang.Object implements PlexusConfiguration
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.String,java.lang.String> |
attributes |
private java.util.List<PlexusConfiguration> |
childList |
private java.util.Map<java.lang.String,java.util.List<PlexusConfiguration>> |
childMap |
private java.lang.String |
name |
private java.lang.String |
value |
| Modifier | Constructor and Description |
|---|---|
protected |
DefaultPlexusConfiguration() |
protected |
DefaultPlexusConfiguration(java.lang.String name) |
protected |
DefaultPlexusConfiguration(java.lang.String name,
java.lang.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(java.lang.String name)
Add a child element with a given name and return the newly created element.
|
PlexusConfiguration |
addChild(java.lang.String name,
java.lang.String value)
Add a child element with a given name, and given value and return the
newly created element.
|
java.lang.String |
getAttribute(java.lang.String name)
Returns the value of the named attribute.
|
java.lang.String |
getAttribute(java.lang.String name,
java.lang.String defaultValue)
Returns the value of the named attribute, or default if one cannot be
found.
|
java.lang.String[] |
getAttributeNames()
Returns an array of attribute names.
|
PlexusConfiguration |
getChild(int i)
Returns the child configuration at the given location.
|
PlexusConfiguration |
getChild(java.lang.String name)
Returns the child configuration of the given name.
|
PlexusConfiguration |
getChild(java.lang.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(java.lang.String name)
Returns an array of all child configurations with the given name.
|
java.lang.String |
getName()
Returns the name of this configuration.
|
java.lang.String |
getValue()
Returns the value of this configuration.
|
java.lang.String |
getValue(java.lang.String defaultValue)
Returns the value of this configuration, or default if one cannot be
found.
|
void |
setAttribute(java.lang.String name,
java.lang.String value)
Sets an attribute on this configuration.
|
void |
setName(java.lang.String name)
Sets the name of this configuration.
|
void |
setValue(java.lang.String val)
Set the value of a configuration element.
|
PlexusConfiguration |
setValueAndGetSelf(java.lang.String val)
Set the value of a configuration element and return the PlexusConfiguration object
so that further operations can be carried out.
|
private java.lang.String name
private java.lang.String value
private java.util.Map<java.lang.String,java.lang.String> attributes
private java.util.Map<java.lang.String,java.util.List<PlexusConfiguration>> childMap
private java.util.List<PlexusConfiguration> childList
protected DefaultPlexusConfiguration()
protected DefaultPlexusConfiguration(java.lang.String name)
protected DefaultPlexusConfiguration(java.lang.String name,
java.lang.String value)
public java.lang.String getName()
PlexusConfigurationgetName in interface PlexusConfigurationpublic void setName(java.lang.String name)
PlexusConfigurationsetName in interface PlexusConfigurationname - The name of the configuration.public java.lang.String getValue()
PlexusConfigurationgetValue in interface PlexusConfigurationpublic java.lang.String getValue(java.lang.String defaultValue)
PlexusConfigurationgetValue in interface PlexusConfigurationdefaultValue - value to return if none is foundpublic void setValue(java.lang.String val)
PlexusConfigurationsetValue in interface PlexusConfigurationval - The value of the configuration element.public PlexusConfiguration setValueAndGetSelf(java.lang.String val)
PlexusConfigurationsetValueAndGetSelf in interface PlexusConfigurationval - set the value.PlexusConfigurationpublic void setAttribute(java.lang.String name,
java.lang.String value)
PlexusConfigurationsetAttribute in interface PlexusConfigurationname - name of the attributevalue - the value of the attribute.public java.lang.String getAttribute(java.lang.String name)
PlexusConfigurationgetAttribute in interface PlexusConfigurationname - The name of the attribute.public java.lang.String getAttribute(java.lang.String name,
java.lang.String defaultValue)
PlexusConfigurationgetAttribute in interface PlexusConfigurationname - The name of the attribute.defaultValue - value to return if none is foundpublic java.lang.String[] getAttributeNames()
PlexusConfigurationgetAttributeNames in interface PlexusConfigurationpublic PlexusConfiguration getChild(java.lang.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(java.lang.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(java.lang.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(java.lang.String name)
PlexusConfigurationaddChild in interface PlexusConfigurationname - The name of the element.PlexusConfigurationpublic PlexusConfiguration addChild(java.lang.String name, java.lang.String value)
PlexusConfigurationaddChild in interface PlexusConfigurationname - The name of the child element.value - The value of the child element.PlexusConfigurationpublic int getChildCount()
PlexusConfigurationgetChildCount in interface PlexusConfiguration