Class UnusedCatchParameterShouldBeUnnamedCheck.CatchParameterDetails
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.checks.coding.UnusedCatchParameterShouldBeUnnamedCheck.CatchParameterDetails
-
- Enclosing class:
- UnusedCatchParameterShouldBeUnnamedCheck
private static final class UnusedCatchParameterShouldBeUnnamedCheck.CatchParameterDetails extends Object
Maintains information about the catch parameter.
-
-
Field Summary
Fields Modifier and Type Field Description private String
name
The name of the catch parameter.private DetailAST
parameterDefinition
Ast of typeTokenTypes.PARAMETER_DEF
to use it when logging.private boolean
used
Is the variable used.
-
Constructor Summary
Constructors Modifier Constructor Description private
CatchParameterDetails(DetailAST enclosingCatchClause)
Create a new catch parameter instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private String
getName()
Get the name of the catch parameter.private DetailAST
getParameterDefinition()
Get the parameter definition token of the catch parameter represented by ast of typeTokenTypes.PARAMETER_DEF
.private boolean
isUsed()
Check if the catch parameter is used.private void
registerAsUsed()
Register the catch parameter as used.
-
-
-
Field Detail
-
parameterDefinition
private final DetailAST parameterDefinition
Ast of typeTokenTypes.PARAMETER_DEF
to use it when logging.
-
used
private boolean used
Is the variable used.
-
-
Constructor Detail
-
CatchParameterDetails
private CatchParameterDetails(DetailAST enclosingCatchClause)
Create a new catch parameter instance.- Parameters:
enclosingCatchClause
- ast of typeTokenTypes.LITERAL_CATCH
-
-
Method Detail
-
registerAsUsed
private void registerAsUsed()
Register the catch parameter as used.
-
getName
private String getName()
Get the name of the catch parameter.- Returns:
- the name of the catch parameter
-
isUsed
private boolean isUsed()
Check if the catch parameter is used.- Returns:
- true if the catch parameter is used
-
getParameterDefinition
private DetailAST getParameterDefinition()
Get the parameter definition token of the catch parameter represented by ast of typeTokenTypes.PARAMETER_DEF
.- Returns:
- the ast of type
TokenTypes.PARAMETER_DEF
-
-