Class DefaultPlexusConfiguration

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      void addChild​(PlexusConfiguration child)
      Adds a configuration under this configuration, which acts as a parent.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • name

        private java.lang.String name
      • value

        private java.lang.String value
      • attributes

        private java.util.Map<java.lang.String,​java.lang.String> attributes
      • childMap

        private java.util.Map<java.lang.String,​java.util.List<PlexusConfiguration>> childMap
    • Constructor Detail

      • DefaultPlexusConfiguration

        protected DefaultPlexusConfiguration()
      • DefaultPlexusConfiguration

        protected DefaultPlexusConfiguration​(java.lang.String name)
      • DefaultPlexusConfiguration

        protected DefaultPlexusConfiguration​(java.lang.String name,
                                             java.lang.String value)
    • Method Detail

      • 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
      • setName

        public void setName​(java.lang.String name)
        Description copied from interface: PlexusConfiguration
        Sets the name of this configuration.
        Specified by:
        setName in interface PlexusConfiguration
        Parameters:
        name - The name of the 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 val)
        Description copied from interface: PlexusConfiguration
        Set the value of a configuration element.
        Specified by:
        setValue in interface PlexusConfiguration
        Parameters:
        val - The value of the configuration element.
      • setAttribute

        public void setAttribute​(java.lang.String name,
                                 java.lang.String value)
        Description copied from interface: PlexusConfiguration
        Sets an attribute on this configuration.
        Specified by:
        setAttribute in interface PlexusConfiguration
        Parameters:
        name - name of the attribute
        value - the value of the 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
        Parameters:
        name - The name of the attribute.
        Returns:
        the value of the named attribute
      • 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
        Parameters:
        name - The name of the attribute.
        defaultValue - value to return if none is found
        Returns:
        the value of the named attribute
      • 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​(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 PlexusConfiguration addChild​(java.lang.String name,
                                            java.lang.String value)
        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 interface PlexusConfiguration
        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 interface PlexusConfiguration
        Returns:
        the number of directly children under this configuration.