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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CheckstyleConfiguration(com.puppycrawl.tools.checkstyle.api.Configuration conf, Set<String> allowedLeavesIdentifiers)
CheckstyleConfiguration(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSubConfiguration(CheckstyleConfiguration configuration)
boolean
containsCheck(String identifier)
Checks if the Configuration contains a Subconfiguration/Module with the given identifier.CheckstyleConfiguration
findModule(String identifier)
String
getAttribute(String name)
String[]
getAttributeNames()
com.puppycrawl.tools.checkstyle.api.Configuration[]
getChildren()
int
getCiteLinesAfter(String identifier)
int
getCiteLinesBefore(String identifier)
String
getIdentifier()
List<String>
getListOfConfiguredCheckIdentifiers()
int
getMaxReportsPerFile(String identifier)
com.google.common.collect.ImmutableMap<String,String>
getMessages()
CheckMetadata
getMetadata()
CheckMetadata
getMetadata(String identifier)
String
getName()
String
getProperty(String name)
String[]
getPropertyNames()
CheckstyleConfiguration
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 Detail
-
CheckstyleConfiguration
public CheckstyleConfiguration(String name)
-
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 Detail
-
addSubConfiguration
public void addSubConfiguration(CheckstyleConfiguration configuration)
-
containsCheck
public boolean containsCheck(String identifier)
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
public CheckstyleConfiguration getSubConfigurationByIdentifier(String identifier)
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
public String[] getAttributeNames()
- Specified by:
getAttributeNames
in interfacecom.puppycrawl.tools.checkstyle.api.Configuration
-
getPropertyNames
public String[] 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
-
getChildren
public com.puppycrawl.tools.checkstyle.api.Configuration[] getChildren()
- Specified by:
getChildren
in interfacecom.puppycrawl.tools.checkstyle.api.Configuration
-
getName
public String getName()
- Specified by:
getName
in interfacecom.puppycrawl.tools.checkstyle.api.Configuration
-
getIdentifier
public String getIdentifier()
-
getMessages
public com.google.common.collect.ImmutableMap<String,String> getMessages()
- Specified by:
getMessages
in interfacecom.puppycrawl.tools.checkstyle.api.Configuration
-
setMetadata
public void setMetadata(CheckMetadata metadata)
-
getMetadata
public CheckMetadata getMetadata()
-
getMetadata
public CheckMetadata getMetadata(String identifier)
-
findModule
public CheckstyleConfiguration findModule(String identifier)
-
isReplaceTabs
public boolean isReplaceTabs(String identifier)
-
getMaxReportsPerFile
public int getMaxReportsPerFile(String identifier)
-
getCiteLinesBefore
public int getCiteLinesBefore(String identifier)
-
getCiteLinesAfter
public int getCiteLinesAfter(String identifier)
-
-