## com.puppycrawl.tools.checkstyle
Class DefaultConfiguration

    java.lang.Object
      com.puppycrawl.tools.checkstyle.DefaultConfiguration

All Implemented Interfaces:
  Configuration, Serializable

    public final class DefaultConfiguration

extends Object
implements Configuration

Default implementation of the Configuration interface.

Author:
  lkuehne
See Also:
  Serialized Form

Constructor Summary
`DefaultConfiguration(String aName)` Instantiates a DefaultConfiguration.

Method Summary
`void` `addAttribute(String aName, String aValue)` Adds an attribute to this configuration.
`void` `addChild(Configuration aConfiguration)` Makes a configuration a child of this configuration.
`void` `addMessage(String aKey, String aValue)` Adds a custom message to this configuration.
`String` `getAttribute(String aName)` The attribute value for an attribute name.
`String[]` `getAttributeNames()` The set of attribute names.
`Configuration[]` `getChildren()` The set of child configurations.
`com.google.common.collect.ImmutableMap<String,String>` `getMessages()` Returns an unmodifiable map instance containing the custom messages for this configuration.
`String` `getName()` The name of this configuration.
`void` `removeChild(Configuration aConfiguration)` Removes a child of this configuration.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DefaultConfiguration

    public DefaultConfiguration(String aName)

  Instantiates a DefaultConfiguration.

  Parameters:
    `aName` - the name for this DefaultConfiguration.

Method Detail

### getAttributeNames

    public String[] getAttributeNames()

  The set of attribute names.

  Specified by:
    `getAttributeNames` in interface `Configuration`
  Returns:
    The set of attribute names, never null.

### getAttribute

    public String getAttribute(String aName)
                        throws CheckstyleException

  The attribute value for an attribute name.

  Specified by:
    `getAttribute` in interface `Configuration`
  Parameters:
    `aName` - the attribute name
  Returns:
    the value that is associated with aName
  Throws:
    `CheckstyleException` - if aName is not a valid attribute name

### getChildren

    public Configuration[] getChildren()

  The set of child configurations.

  Specified by:
    `getChildren` in interface `Configuration`
  Returns:
    The set of child configurations, never null.

### getName

    public String getName()

  The name of this configuration.

  Specified by:
    `getName` in interface `Configuration`
  Returns:
    The name of this configuration.

### addChild

    public void addChild(Configuration aConfiguration)

  Makes a configuration a child of this configuration.

  Parameters:
    `aConfiguration` - the child configuration.

### removeChild

    public void removeChild(Configuration aConfiguration)

  Removes a child of this configuration.

  Parameters:
    `aConfiguration` - the child configuration to remove.

### addAttribute

    public void addAttribute(String aName,
                             String aValue)

  Adds an attribute to this configuration.

  Parameters:
    `aName` - the name of the attribute.
    `aValue` - the value of the attribute.

### addMessage

    public void addMessage(String aKey,
                           String aValue)

  Adds a custom message to this configuration.

  Parameters:
    `aKey` - the message key
    `aValue` - the custom message pattern

### getMessages

    public com.google.common.collect.ImmutableMap<String,String> getMessages()

  Returns an unmodifiable map instance containing the custom messages for this configuration.

  Specified by:
    `getMessages` in interface `Configuration`
  Returns:
    unmodifiable map containing custom messages

Copyright © 2001-2011. All Rights Reserved.