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 java.lang.Object
implements PlexusConfiguration

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

Field Summary
private  org.codehaus.plexus.util.xml.Xpp3Dom dom
           
 
Constructor Summary
XmlPlexusConfiguration(java.lang.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.
private  void attributes(PlexusConfiguration c, java.lang.StringBuffer sb)
           
private  void display(PlexusConfiguration c, java.lang.StringBuffer sb, int depth)
           
private  void displayTag(PlexusConfiguration c, java.lang.StringBuffer sb, int depth)
           
 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.
 org.codehaus.plexus.util.xml.Xpp3Dom getXpp3Dom()
           
private  java.lang.String indent(int depth)
           
 void setAttribute(java.lang.String name, java.lang.String value)
           
 void setValue(java.lang.String value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dom

private org.codehaus.plexus.util.xml.Xpp3Dom dom
Constructor Detail

XmlPlexusConfiguration

public XmlPlexusConfiguration(java.lang.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 java.lang.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 java.lang.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 java.lang.String getValue(java.lang.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(java.lang.String value)

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)

getAttribute

public java.lang.String getAttribute(java.lang.String name,
                                     java.lang.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 java.lang.String getAttribute(java.lang.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 java.lang.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(java.lang.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(java.lang.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(java.lang.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 java.lang.String toString()
Overrides:
toString in class java.lang.Object

display

private void display(PlexusConfiguration c,
                     java.lang.StringBuffer sb,
                     int depth)

displayTag

private void displayTag(PlexusConfiguration c,
                        java.lang.StringBuffer sb,
                        int depth)

attributes

private void attributes(PlexusConfiguration c,
                        java.lang.StringBuffer sb)

indent

private java.lang.String indent(int depth)