Package com.puppycrawl.tools.checkstyle
Class DefaultConfiguration
java.lang.Object
com.puppycrawl.tools.checkstyle.DefaultConfiguration
- All Implemented Interfaces:
Configuration
,Serializable
Default implementation of the Configuration interface.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultConfiguration
(String name) Instantiates a DefaultConfiguration.DefaultConfiguration
(String name, ThreadModeSettings threadModeSettings) Instantiates a DefaultConfiguration. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute
(String attributeName, String value) Adds an attribute to this configuration.void
addChild
(Configuration configuration) Makes a configuration a child of this configuration.void
addMessage
(String key, String value) Adds a custom message to this configuration.getAttribute
(String attributeName) The attribute value for an attribute name.String[]
The set of attribute names.The set of child configurations.Returns an unmodifiable map instance containing the custom messages for this configuration.getName()
The name of this configuration.Gets the thread mode configuration.void
removeChild
(Configuration configuration) Removes a child of this configuration.
-
Constructor Details
-
DefaultConfiguration
Instantiates a DefaultConfiguration.- Parameters:
name
- the name for this DefaultConfiguration.
-
DefaultConfiguration
Instantiates a DefaultConfiguration.- Parameters:
name
- the name for this DefaultConfiguration.threadModeSettings
- the thread mode configuration.
-
-
Method Details
-
getAttributeNames
Description copied from interface:Configuration
The set of attribute names.- Specified by:
getAttributeNames
in interfaceConfiguration
- Returns:
- The set of attribute names, never null.
-
getAttribute
Description copied from interface:Configuration
The attribute value for an attribute name.- Specified by:
getAttribute
in interfaceConfiguration
- Parameters:
attributeName
- the attribute name- Returns:
- the value that is associated with name
- Throws:
CheckstyleException
- if name is not a valid attribute name
-
getChildren
Description copied from interface:Configuration
The set of child configurations.- Specified by:
getChildren
in interfaceConfiguration
- Returns:
- The set of child configurations, never null.
-
getName
Description copied from interface:Configuration
The name of this configuration.- Specified by:
getName
in interfaceConfiguration
- Returns:
- The name of this configuration.
-
addChild
Makes a configuration a child of this configuration.- Parameters:
configuration
- the child configuration.
-
removeChild
Removes a child of this configuration.- Parameters:
configuration
- the child configuration to remove.
-
addAttribute
Adds an attribute to this configuration.- Parameters:
attributeName
- the name of the attribute.value
- the value of the attribute.
-
addMessage
Adds a custom message to this configuration.- Parameters:
key
- the message keyvalue
- the custom message pattern
-
getMessages
Returns an unmodifiable map instance containing the custom messages for this configuration.- Specified by:
getMessages
in interfaceConfiguration
- Returns:
- unmodifiable map containing custom messages
-
getThreadModeSettings
Gets the thread mode configuration.- Returns:
- the thread mode configuration.
-