Class RequireThisCheck.AbstractFrame
java.lang.Object
com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck.AbstractFrame
- Direct Known Subclasses:
RequireThisCheck.BlockFrame, RequireThisCheck.CatchFrame, RequireThisCheck.ClassFrame, RequireThisCheck.ConstructorFrame, RequireThisCheck.ForFrame, RequireThisCheck.MethodFrame, RequireThisCheck.TryWithResourcesFrame
- Enclosing class:
RequireThisCheck
A declaration frame.
- Since:
- 3.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DetailASTName identifier token.private final RequireThisCheck.AbstractFrameParent frame.Set of name of variables declared in this frame. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractFrame(RequireThisCheck.AbstractFrame parent, DetailAST ident) Constructor -- invocable only via super() from subclasses. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidAdd a name to the frame.(package private) booleancontainsFieldOrVariable(DetailAST identToFind) Check whether the frame contains a field or a variable with the given name.(package private) booleancontainsFieldOrVariableDef(Set<DetailAST> set, DetailAST ident) Whether the set contains a declaration with the text of the specified IDENT ast and it is declared in a proper position.(package private) StringReturns the name identifier text.(package private) DetailASTReturns the name identifier token.(package private) RequireThisCheck.AbstractFramegetIfContains(DetailAST identToFind, boolean lookForMethod) Check whether the frame contains a given name.(package private) RequireThisCheck.AbstractFrameReturns the parent frame.(package private) abstract RequireThisCheck.FrameTypegetType()Get the type of the frame.(package private) booleanisProperDefinition(DetailAST ident, DetailAST ast) Whether the definition is correspondent to the IDENT.
-
Field Details
-
varIdents
-
parent
Parent frame. -
frameNameIdent
Name identifier token.
-
-
Constructor Details
-
AbstractFrame
AbstractFrame(RequireThisCheck.AbstractFrame parent, DetailAST ident) Constructor -- invocable only via super() from subclasses.- Parameters:
parent- parent frame.ident- frame name ident.
-
-
Method Details
-
getType
-
addIdent
Add a name to the frame.- Parameters:
identToAdd- the name we're adding.
-
getParent
-
getFrameName
-
getFrameNameIdent
-
containsFieldOrVariable
Check whether the frame contains a field or a variable with the given name.- Parameters:
identToFind- the IDENT ast of the name we're looking for.- Returns:
- whether it was found.
-
getIfContains
Check whether the frame contains a given name.- Parameters:
identToFind- IDENT ast of the name we're looking for.lookForMethod- whether we are looking for a method name.- Returns:
- whether it was found.
-
containsFieldOrVariableDef
Whether the set contains a declaration with the text of the specified IDENT ast and it is declared in a proper position.- Parameters:
set- the set of declarations.ident- the specified IDENT ast.- Returns:
- true if the set contains a declaration with the text of the specified IDENT ast and it is declared in a proper position.
-
isProperDefinition
-