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 voidbeginTree(DetailAST pRootAst)Set<Integer>getRelevantTokens()The tokens which this check is interested in.protected voidleaveKnownType(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.voidsetBaseDir(String pBaseDir)voidsetCaseSensitive(boolean pCaseSensitive)voidsetEnumArgument(boolean pEnumArgument)voidsetExcludedFields(String pExcludedFields)voidsetFileExludes(String pFileExludes)voidsetPropertyFile(String pTemplate)voidsetPropertyFileEncoding(String pEncoding)voidsetReportDuplicates(boolean pReportDuplicates)voidsetReportOrphans(boolean pReportOrphans)voidsetSelection(String pSelection)protected voidvisitKnownType(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 voidvisitToken(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:AbstractAddonsCheckThe tokens which this check is interested in. Will be added to the tokens of the base class.- Specified by:
getRelevantTokensin classAbstractAddonsCheck- Returns:
- the relevant tokens
-
beginTree
public void beginTree(DetailAST pRootAst)
- Overrides:
beginTreein classAbstractAddonsCheck
-
visitKnownType
protected void visitKnownType(@Nonnull BinaryName pBinaryClassName, @Nonnull DetailAST pAst)
Description copied from class:AbstractAddonsCheckCalled 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:
visitKnownTypein 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:AbstractAddonsCheckCalled 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:
leaveKnownTypein 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:AbstractAddonsCheckCalled to process a token.- Overrides:
visitTokenin 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)
-
-