Class PropertyCatalogCheck
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.api.AutomaticBean
-
- com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
-
- com.puppycrawl.tools.checkstyle.api.AbstractCheck
-
- com.thomasjensen.checkstyle.addons.checks.AbstractAddonsCheck
-
- com.thomasjensen.checkstyle.addons.checks.misc.PropertyCatalogCheck
-
- All Implemented Interfaces:
Configurable
,Contextualizable
public class PropertyCatalogCheck extends AbstractAddonsCheck
This check helps keeping a property file in sync with a piece of code that contains the property keys.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
AutomaticBean.OutputStreamOptions
-
-
Constructor Summary
Constructors Constructor Description PropertyCatalogCheck()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beginTree(DetailAST pRootAst)
Set<Integer>
getRelevantTokens()
The tokens which this check is interested in.protected void
leaveKnownType(BinaryName pBinaryClassName, DetailAST pAst)
Called after leaving a CLASS_DEF, INTERFACE_DEF, ANNOTATION_DEF, or ENUM_DEF token and the type's binary class name is known.void
setBaseDir(String pBaseDir)
void
setCaseSensitive(boolean pCaseSensitive)
void
setEnumArgument(boolean pEnumArgument)
void
setExcludedFields(String pExcludedFields)
void
setFileExludes(String pFileExludes)
void
setPropertyFile(String pTemplate)
void
setPropertyFileEncoding(String pEncoding)
void
setReportDuplicates(boolean pReportDuplicates)
void
setReportOrphans(boolean pReportOrphans)
void
setSelection(String pSelection)
protected void
visitKnownType(BinaryName pBinaryClassName, DetailAST pAst)
Called after visiting a CLASS_DEF, INTERFACE_DEF, ANNOTATION_DEF, or ENUM_DEF token and successfully determining the type's binary class name.protected void
visitToken(BinaryName pBinaryClassName, DetailAST pAst)
Called to process a token.-
Methods inherited from class com.thomasjensen.checkstyle.addons.checks.AbstractAddonsCheck
finishTree, finishTree, getAcceptableTokens, getApiFixer, getClassDeclarationPosition, getCurrentBinaryName, getCurrentSimpleName, getDefaultTokens, getMyPackage, getRequiredTokens, leaveToken, leaveToken, visitToken
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck
clearViolations, destroy, getLine, getLineCodePoints, getLines, getTabWidth, getTokenNames, getViolations, init, isCommentNodesRequired, log, log, log, setFileContents, setTabWidth, setTokens
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverity
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
configure, contextualize, getConfiguration, setupChild
-
-
-
-
Method Detail
-
getRelevantTokens
public Set<Integer> getRelevantTokens()
Description copied from class:AbstractAddonsCheck
The tokens which this check is interested in. Will be added to the tokens of the base class.- Specified by:
getRelevantTokens
in classAbstractAddonsCheck
- Returns:
- the relevant tokens
-
beginTree
public void beginTree(DetailAST pRootAst)
- Overrides:
beginTree
in classAbstractAddonsCheck
-
visitKnownType
protected void visitKnownType(@Nonnull BinaryName pBinaryClassName, @Nonnull DetailAST pAst)
Description copied from class:AbstractAddonsCheck
Called after visiting a CLASS_DEF, INTERFACE_DEF, ANNOTATION_DEF, or ENUM_DEF token and successfully determining the type's binary class name. This is useful in a Java source file with nested inner classes. If the implementing check registers for any of the above tokens, the regular call toAbstractAddonsCheck.visitToken(BinaryName, DetailAST)
will be performed in addition to (after) this one.- Overrides:
visitKnownType
in classAbstractAddonsCheck
- Parameters:
pBinaryClassName
- the binary class name of the visited typepAst
- the token to process
-
leaveKnownType
protected void leaveKnownType(@Nonnull BinaryName pBinaryClassName, @Nonnull DetailAST pAst)
Description copied from class:AbstractAddonsCheck
Called after leaving a CLASS_DEF, INTERFACE_DEF, ANNOTATION_DEF, or ENUM_DEF token and the type's binary class name is known. This is useful in a Java source file with nested inner classes. If the implementing check registers for any of the above tokens, the regular call toAbstractAddonsCheck.leaveToken(BinaryName, DetailAST)
will be performed in addition to (before) this one.- Overrides:
leaveKnownType
in classAbstractAddonsCheck
- Parameters:
pBinaryClassName
- the binary class name of the visited typepAst
- the token being completed
-
visitToken
protected void visitToken(@Nullable BinaryName pBinaryClassName, @Nonnull DetailAST pAst)
Description copied from class:AbstractAddonsCheck
Called to process a token.- Overrides:
visitToken
in classAbstractAddonsCheck
- Parameters:
pBinaryClassName
- the currently active binary class namepAst
- the token to process
-
setBaseDir
public void setBaseDir(String pBaseDir)
-
setFileExludes
public void setFileExludes(String pFileExludes)
-
setSelection
public void setSelection(String pSelection)
-
setExcludedFields
public void setExcludedFields(String pExcludedFields)
-
setEnumArgument
public void setEnumArgument(boolean pEnumArgument)
-
setPropertyFile
public void setPropertyFile(String pTemplate)
-
setPropertyFileEncoding
public void setPropertyFileEncoding(String pEncoding)
-
setReportDuplicates
public void setReportDuplicates(boolean pReportDuplicates)
-
setReportOrphans
public void setReportOrphans(boolean pReportOrphans)
-
setCaseSensitive
public void setCaseSensitive(boolean pCaseSensitive)
-
-