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
FieldsModifier and TypeFieldDescriptionprivate final String
The name of the catch parameter.private final DetailAST
Ast of typeTokenTypes.PARAMETER_DEF
to use it when logging.private boolean
Is the variable used. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
CatchParameterDetails
(DetailAST enclosingCatchClause) Create a new catch parameter instance. -
Method Summary
Modifier and TypeMethodDescriptionprivate String
getName()
Get the name of the catch parameter.private DetailAST
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
Register the catch parameter as used.
-
Field Details
-
name
The name of the catch parameter. -
parameterDefinition
Ast of typeTokenTypes.PARAMETER_DEF
to use it when logging. -
used
Is the variable used.
-
-
Constructor Details
-
CatchParameterDetails
Create a new catch parameter instance.- Parameters:
enclosingCatchClause
- ast of typeTokenTypes.LITERAL_CATCH
-
-
Method Details
-
registerAsUsed
Register the catch parameter as used. -
getName
Get the name of the catch parameter.- Returns:
- the name of the catch parameter
-
isUsed
Check if the catch parameter is used.- Returns:
- true if the catch parameter is used
-
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
-