Class DefaultPlexusConfiguration
java.lang.Object
org.codehaus.plexus.configuration.DefaultPlexusConfiguration
- All Implemented Interfaces:
PlexusConfiguration
- Direct Known Subclasses:
XmlPlexusConfiguration
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
protected
protected
DefaultPlexusConfiguration
(String name, String value) -
Method Summary
Modifier and TypeMethodDescriptionAdd a child element with a given name and return the newly created element.Add a child element with a given name, and given value and return the newly created element.void
addChild
(PlexusConfiguration child) Adds a configuration under this configuration, which acts as a parent.getAttribute
(String name) Returns the value of the named attribute.getAttribute
(String name, String defaultValue) Returns the value of the named attribute, or default if one cannot be found.String[]
Returns an array of attribute names.getChild
(int i) Returns the child configuration at the given location.Returns the child configuration of the given name.Returns the child configuration of the given name.int
Returns the number of directly children under this configuration.Returns an array of all child configurations.getChildren
(String name) Returns an array of all child configurations with the given name.getName()
Returns the name of this configuration.getValue()
Returns the value of this configuration.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
Sets the name of this configuration.void
Set the value of a configuration element.setValueAndGetSelf
(String val) Set the value of a configuration element and return the PlexusConfiguration object so that further operations can be carried out.
-
Constructor Details
-
DefaultPlexusConfiguration
protected DefaultPlexusConfiguration() -
DefaultPlexusConfiguration
-
DefaultPlexusConfiguration
-
-
Method Details
-
getName
Description copied from interface:PlexusConfiguration
Returns the name of this configuration.- Specified by:
getName
in interfacePlexusConfiguration
- Returns:
- the name of this configuration
-
setName
Description copied from interface:PlexusConfiguration
Sets the name of this configuration.- Specified by:
setName
in interfacePlexusConfiguration
- Parameters:
name
- The name of the configuration.
-
getValue
Description copied from interface:PlexusConfiguration
Returns the value of this configuration.- Specified by:
getValue
in interfacePlexusConfiguration
- Returns:
- the value of this configuration
-
getValue
Description copied from interface:PlexusConfiguration
Returns the value of this configuration, or default if one cannot be found.- Specified by:
getValue
in interfacePlexusConfiguration
- Parameters:
defaultValue
- value to return if none is found- Returns:
- the value of this configuration
-
setValue
Description copied from interface:PlexusConfiguration
Set the value of a configuration element.- Specified by:
setValue
in interfacePlexusConfiguration
- Parameters:
val
- The value of the configuration element.
-
setValueAndGetSelf
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:
setValueAndGetSelf
in interfacePlexusConfiguration
- Parameters:
val
- set the value.- Returns:
PlexusConfiguration
-
setAttribute
Description copied from interface:PlexusConfiguration
Sets an attribute on this configuration.- Specified by:
setAttribute
in interfacePlexusConfiguration
- Parameters:
name
- name of the attributevalue
- the value of the attribute.
-
getAttribute
Description copied from interface:PlexusConfiguration
Returns the value of the named attribute.- Specified by:
getAttribute
in interfacePlexusConfiguration
- Parameters:
name
- The name of the attribute.- Returns:
- the value of the named attribute
-
getAttribute
Description copied from interface:PlexusConfiguration
Returns the value of the named attribute, or default if one cannot be found.- Specified by:
getAttribute
in interfacePlexusConfiguration
- Parameters:
name
- The name of the attribute.defaultValue
- value to return if none is found- Returns:
- the value of the named attribute
-
getAttributeNames
Description copied from interface:PlexusConfiguration
Returns an array of attribute names.- Specified by:
getAttributeNames
in interfacePlexusConfiguration
- Returns:
- an array of attribute names
-
getChild
Description copied from interface:PlexusConfiguration
Returns the child configuration of the given name.- Specified by:
getChild
in interfacePlexusConfiguration
- Parameters:
name
- the name of the child to return- Returns:
- the child configuration of the given name
-
getChild
Description copied from interface:PlexusConfiguration
Returns the child configuration at the given location.- Specified by:
getChild
in interfacePlexusConfiguration
- Parameters:
i
- the position of the child under this configuration- Returns:
- the child configuration at the given location
-
getChild
Description copied from interface:PlexusConfiguration
Returns the child configuration of the given name.- Specified by:
getChild
in interfacePlexusConfiguration
- Parameters:
name
- the name of the child to returncreateChild
- 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
Description copied from interface:PlexusConfiguration
Returns an array of all child configurations.- Specified by:
getChildren
in interfacePlexusConfiguration
- Returns:
- an array of all child configurations
-
getChildren
Description copied from interface:PlexusConfiguration
Returns an array of all child configurations with the given name.- Specified by:
getChildren
in interfacePlexusConfiguration
- Parameters:
name
- the name of the children configurations to return- Returns:
- an array of all child configurations with the given name
-
addChild
Description copied from interface:PlexusConfiguration
Adds a configuration under this configuration, which acts as a parent.- Specified by:
addChild
in interfacePlexusConfiguration
- Parameters:
child
- the child configuration to add
-
addChild
Description copied from interface:PlexusConfiguration
Add a child element with a given name and return the newly created element.- Specified by:
addChild
in interfacePlexusConfiguration
- Parameters:
name
- The name of the element.- Returns:
PlexusConfiguration
-
addChild
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 interfacePlexusConfiguration
- Parameters:
name
- The name of the child element.value
- The value of the child element.- Returns:
PlexusConfiguration
-
getChildCount
public int getChildCount()Description copied from interface:PlexusConfiguration
Returns the number of directly children under this configuration.- Specified by:
getChildCount
in interfacePlexusConfiguration
- Returns:
- the number of directly children under this configuration.
-