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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<Configuration>The list of child Configurations.private static final Configuration[]Constant for optimization.The map containing custom messages.private final StringThe name of this configuration.The map from property names to property values.private static final longA unique serial version identifier.private final ThreadModeSettingsThe thread mode configuration. -
Constructor Summary
ConstructorsConstructorDescriptionDefaultConfiguration(String name) Instantiates a DefaultConfiguration.DefaultConfiguration(String name, ThreadModeSettings threadModeSettings) Instantiates a DefaultConfiguration. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String attributeName, String value) Deprecated.This shall be removed in future releases.voidaddChild(Configuration configuration) Makes a configuration a child of this configuration.voidaddMessage(String key, String value) Adds a custom message to this configuration.voidaddProperty(String propertyName, String value) Adds n property 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.getProperty(String propertyName) The property value for property name.String[]The set of property names.Gets the thread mode configuration.voidremoveChild(Configuration configuration) Removes a child of this configuration.
-
Field Details
-
serialVersionUID
A unique serial version identifier.- See Also:
-
EMPTY_CONFIGURATION_ARRAY
Constant for optimization. -
name
The name of this configuration. -
children
The list of child Configurations. -
propertyMap
The map from property names to property values. -
messages
The map containing custom messages. -
threadModeSettings
The thread mode 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:ConfigurationThe set of attribute names.- Specified by:
getAttributeNamesin interfaceConfiguration- Returns:
- The set of attribute names, never null.
-
getAttribute
Description copied from interface:ConfigurationThe attribute value for an attribute name.- Specified by:
getAttributein interfaceConfiguration- Parameters:
attributeName- the attribute name- Returns:
- the value that is associated with name
- Throws:
CheckstyleException- if name is not a valid attribute name
-
getPropertyNames
Description copied from interface:ConfigurationThe set of property names.- Specified by:
getPropertyNamesin interfaceConfiguration- Returns:
- The set of property names, never null.
-
getProperty
Description copied from interface:ConfigurationThe property value for property name.- Specified by:
getPropertyin interfaceConfiguration- Parameters:
propertyName- the property name- Returns:
- the value that is associated with name
- Throws:
CheckstyleException- if name is not a valid property name
-
getChildren
Description copied from interface:ConfigurationThe set of child configurations.- Specified by:
getChildrenin interfaceConfiguration- Returns:
- The set of child configurations, never null.
-
getName
Description copied from interface:ConfigurationThe name of this configuration.- Specified by:
getNamein 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
Deprecated.This shall be removed in future releases. Please useaddProperty(String propertyName, String value)instead.Adds n property to this configuration.- Parameters:
attributeName- the name of the property.value- the value of the property.
-
addProperty
Adds n property to this configuration.- Parameters:
propertyName- the name of the property.value- the value of the property.
-
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:
getMessagesin interfaceConfiguration- Returns:
- unmodifiable map containing custom messages
-
getThreadModeSettings
Gets the thread mode configuration.- Returns:
- the thread mode configuration.
-