private abstract static class RequireThisCheck.AbstractFrame
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private DetailAST |
frameNameIdent
Name identifier token.
|
private RequireThisCheck.AbstractFrame |
parent
Parent frame.
|
private java.util.Set<DetailAST> |
varIdents
Set of name of variables declared in this frame.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractFrame(RequireThisCheck.AbstractFrame parent,
DetailAST ident)
Constructor -- invokable only via super() from subclasses.
|
Modifier and Type | Method and Description |
---|---|
private void |
addIdent(DetailAST identToAdd)
Add a name to the frame.
|
private static boolean |
checkPosition(DetailAST ast1,
DetailAST ast2)
Whether the declaration is located before the checked ast.
|
protected boolean |
containsFieldOrVariable(DetailAST nameToFind)
Check whether the frame contains a field or a variable with the given name.
|
protected boolean |
containsFieldOrVariableDef(java.util.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.
|
protected java.lang.String |
getFrameName() |
DetailAST |
getFrameNameIdent() |
protected RequireThisCheck.AbstractFrame |
getIfContains(DetailAST nameToFind,
boolean lookForMethod)
Check whether the frame contains a given name.
|
protected RequireThisCheck.AbstractFrame |
getParent() |
protected abstract RequireThisCheck.FrameType |
getType()
Get the type of the frame.
|
protected boolean |
isProperDefinition(DetailAST ident,
DetailAST ast)
Whether the definition is correspondent to the IDENT.
|
private final java.util.Set<DetailAST> varIdents
private final RequireThisCheck.AbstractFrame parent
private final DetailAST frameNameIdent
protected AbstractFrame(RequireThisCheck.AbstractFrame parent, DetailAST ident)
parent
- parent frame.ident
- frame name ident.protected abstract RequireThisCheck.FrameType getType()
private void addIdent(DetailAST identToAdd)
identToAdd
- the name we're adding.protected RequireThisCheck.AbstractFrame getParent()
protected java.lang.String getFrameName()
public DetailAST getFrameNameIdent()
protected boolean containsFieldOrVariable(DetailAST nameToFind)
nameToFind
- the IDENT ast of the name we're looking for.protected RequireThisCheck.AbstractFrame getIfContains(DetailAST nameToFind, boolean lookForMethod)
nameToFind
- IDENT ast of the name we're looking for.lookForMethod
- whether we are looking for a method name.protected boolean containsFieldOrVariableDef(java.util.Set<DetailAST> set, DetailAST ident)
set
- the set of declarations.ident
- the specified IDENT ast.protected boolean isProperDefinition(DetailAST ident, DetailAST ast)
ident
- the IDENT ast to check.ast
- the IDENT ast of the definition to check.