Package de.hsh.graja.modules.checkstyle
Class CheckstyleConfiguration
java.lang.Object
de.hsh.graja.modules.checkstyle.CheckstyleConfiguration
- All Implemented Interfaces:
com.puppycrawl.tools.checkstyle.api.Configuration
,Serializable
public class CheckstyleConfiguration
extends Object
implements com.puppycrawl.tools.checkstyle.api.Configuration
Dynamic alternative to the default immutable checkstyle configuration, used to add single checks to the treeWalker "super"-check.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCheckstyleConfiguration
(com.puppycrawl.tools.checkstyle.api.Configuration conf, Set<String> allowedLeavesIdentifiers) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSubConfiguration
(CheckstyleConfiguration configuration) boolean
containsCheck
(String identifier) Checks if the Configuration contains a Subconfiguration/Module with the given identifier.findModule
(String identifier) getAttribute
(String name) String[]
com.puppycrawl.tools.checkstyle.api.Configuration[]
int
getCiteLinesAfter
(String identifier) int
getCiteLinesBefore
(String identifier) int
getMaxReportsPerFile
(String identifier) getMetadata
(String identifier) getName()
getProperty
(String name) String[]
getSubConfigurationByIdentifier
(String identifier) Gets the first Subconfiguration/Module/Check with the given identifier in post-order.boolean
isReplaceTabs
(String identifier) void
setAttribute
(String attributeName, String value) void
setMetadata
(CheckMetadata metadata)
-
Constructor Details
-
CheckstyleConfiguration
-
CheckstyleConfiguration
public CheckstyleConfiguration(com.puppycrawl.tools.checkstyle.api.Configuration conf, Set<String> allowedLeavesIdentifiers) - Parameters:
conf
- the original checkstyle configurationallowedLeavesIdentifiers
- if not null, this set restricts the checkstyle configuration to those in the set (format: <module>#<id>, while the <id> is optional).
-
-
Method Details
-
getListOfConfiguredCheckIdentifiers
-
addSubConfiguration
-
containsCheck
Checks if the Configuration contains a Subconfiguration/Module with the given identifier. Ignores the Configuration this method is called on.- Parameters:
identifier
- identifier of the Subconfiguration/Module/Check.
-
getSubConfigurationByIdentifier
Gets the first Subconfiguration/Module/Check with the given identifier in post-order. Ignores the Configuration this method is called on.- Parameters:
identifier
- given identifier- Returns:
- the found subconfiguration (or null, if not found)
-
getAttributeNames
- Specified by:
getAttributeNames
in interfacecom.puppycrawl.tools.checkstyle.api.Configuration
-
getPropertyNames
- Specified by:
getPropertyNames
in interfacecom.puppycrawl.tools.checkstyle.api.Configuration
-
getAttribute
public String getAttribute(String name) throws com.puppycrawl.tools.checkstyle.api.CheckstyleException - Specified by:
getAttribute
in interfacecom.puppycrawl.tools.checkstyle.api.Configuration
- Throws:
com.puppycrawl.tools.checkstyle.api.CheckstyleException
-
getProperty
public String getProperty(String name) throws com.puppycrawl.tools.checkstyle.api.CheckstyleException - Specified by:
getProperty
in interfacecom.puppycrawl.tools.checkstyle.api.Configuration
- Throws:
com.puppycrawl.tools.checkstyle.api.CheckstyleException
-
setAttribute
-
getChildren
public com.puppycrawl.tools.checkstyle.api.Configuration[] getChildren()- Specified by:
getChildren
in interfacecom.puppycrawl.tools.checkstyle.api.Configuration
-
getName
- Specified by:
getName
in interfacecom.puppycrawl.tools.checkstyle.api.Configuration
-
getIdentifier
-
getMessages
- Specified by:
getMessages
in interfacecom.puppycrawl.tools.checkstyle.api.Configuration
-
setMetadata
-
getMetadata
-
getMetadata
-
findModule
-
isReplaceTabs
-
getMaxReportsPerFile
-
getCiteLinesBefore
-
getCiteLinesAfter
-