Package | Description |
---|---|
com.puppycrawl.tools.checkstyle.checks.coding |
Contains the Coding checks that are
bundled with the main distribution.
|
Modifier and Type | Class and Description |
---|---|
private static class |
RequireThisCheck.AnonymousClassFrame
An anonymous class frame; holds instance variable names.
|
private static class |
RequireThisCheck.BlockFrame
A frame initiated on entering a statement list; holds local variable names.
|
private static class |
RequireThisCheck.ClassFrame
A frame initiated at class, enum or interface definition; holds instance variable names.
|
private static class |
RequireThisCheck.ConstructorFrame
A frame initiated at constructor definition.
|
private static class |
RequireThisCheck.MethodFrame
A frame initiated at method definition; holds a method definition token.
|
Modifier and Type | Field and Description |
---|---|
private RequireThisCheck.AbstractFrame |
RequireThisCheck.current
Frame for the currently processed AST.
|
private RequireThisCheck.AbstractFrame |
RequireThisCheck.AbstractFrame.parent
Parent frame.
|
Modifier and Type | Field and Description |
---|---|
private java.util.Map<DetailAST,RequireThisCheck.AbstractFrame> |
RequireThisCheck.frames
Tree of all the parsed frames.
|
Modifier and Type | Method and Description |
---|---|
private RequireThisCheck.AbstractFrame |
RequireThisCheck.findClassFrame(DetailAST name,
boolean lookForMethod)
Find the class frame containing declaration.
|
private RequireThisCheck.AbstractFrame |
RequireThisCheck.findFrame(DetailAST name,
boolean lookForMethod)
Find frame containing declaration.
|
private static RequireThisCheck.AbstractFrame |
RequireThisCheck.findFrame(RequireThisCheck.AbstractFrame frame,
DetailAST name,
boolean lookForMethod)
Find frame containing declaration.
|
private RequireThisCheck.AbstractFrame |
RequireThisCheck.getClassFrameWhereViolationIsFound(DetailAST ast)
Returns the class frame where violation is found (where the field is used without 'this')
or null otherwise.
|
private RequireThisCheck.AbstractFrame |
RequireThisCheck.getFieldWithoutThis(DetailAST ast,
int parentType)
Returns the frame where the field is declared, if the given field is used without
'this', and null otherwise.
|
protected RequireThisCheck.AbstractFrame |
RequireThisCheck.AbstractFrame.getIfContains(DetailAST nameToFind,
boolean lookForMethod)
Check whether the frame contains a given name.
|
protected RequireThisCheck.AbstractFrame |
RequireThisCheck.ClassFrame.getIfContains(DetailAST nameToFind,
boolean lookForMethod) |
private RequireThisCheck.AbstractFrame |
RequireThisCheck.getMethodWithoutThis(DetailAST ast)
Returns the frame where the method is declared, if the given method is used without
'this' and null otherwise.
|
protected RequireThisCheck.AbstractFrame |
RequireThisCheck.AbstractFrame.getParent() |
Modifier and Type | Method and Description |
---|---|
private static void |
RequireThisCheck.collectVariableDeclarations(DetailAST ast,
RequireThisCheck.AbstractFrame frame)
Collects variable declarations.
|
private static RequireThisCheck.AbstractFrame |
RequireThisCheck.findFrame(RequireThisCheck.AbstractFrame frame,
DetailAST name,
boolean lookForMethod)
Find frame containing declaration.
|
private static boolean |
RequireThisCheck.isInsideConstructorFrame(RequireThisCheck.AbstractFrame frame)
Checks whether a field usage frame is inside constructor frame.
|
private static boolean |
RequireThisCheck.isReturnedVariable(RequireThisCheck.AbstractFrame currentFrame,
DetailAST ident)
Checks whether the current variable is returned from the method.
|
private static boolean |
RequireThisCheck.isUserDefinedArrangementOfThis(RequireThisCheck.AbstractFrame currentFrame,
DetailAST ident)
Checks whether user arranges 'this' for variable in method, constructor, or block on his own.
|
private void |
RequireThisCheck.logViolation(java.lang.String msgKey,
DetailAST ast,
RequireThisCheck.AbstractFrame frame)
Helper method to log a LocalizedMessage.
|
Modifier and Type | Method and Description |
---|---|
private static void |
RequireThisCheck.collectDeclarations(java.util.Deque<RequireThisCheck.AbstractFrame> frameStack,
DetailAST ast)
Parses the next AST for declarations.
|
private void |
RequireThisCheck.endCollectingDeclarations(java.util.Queue<RequireThisCheck.AbstractFrame> frameStack,
DetailAST ast)
Ends parsing of the AST for declarations.
|
Constructor and Description |
---|
AbstractFrame(RequireThisCheck.AbstractFrame parent,
DetailAST ident)
Constructor -- invokable only via super() from subclasses.
|
AnonymousClassFrame(RequireThisCheck.AbstractFrame parent,
java.lang.String frameName)
Creates anonymous class frame.
|
BlockFrame(RequireThisCheck.AbstractFrame parent,
DetailAST ident)
Creates block frame.
|
ClassFrame(RequireThisCheck.AbstractFrame parent,
DetailAST ident)
Creates new instance of ClassFrame.
|
ConstructorFrame(RequireThisCheck.AbstractFrame parent,
DetailAST ident)
Creates a constructor frame.
|
MethodFrame(RequireThisCheck.AbstractFrame parent,
DetailAST ident)
Creates method frame.
|