public static class FlowExpressionParseUtil.FlowExpressionContext extends Object
@A(E)
, the context is the program element that is annotated by @A(E)
.Modifier and Type | Field and Description |
---|---|
List<Receiver> |
arguments
In a context for a method declaration or lambda, the formals.
|
BaseContext |
checkerContext |
Receiver |
outerReceiver |
boolean |
parsingMember
Whether or not the FlowExpressionParser is parsing the "member" part of a member select.
|
Receiver |
receiver |
boolean |
useLocalScope
Whether the TreePath should be used to find identifiers.
|
Constructor and Description |
---|
FlowExpressionContext(Receiver receiver,
List<Receiver> arguments,
BaseContext checkerContext)
Creates context for parsing a flow expression.
|
Modifier and Type | Method and Description |
---|---|
static FlowExpressionParseUtil.FlowExpressionContext |
buildContextForClassDeclaration(ClassTree classTree,
BaseContext checkerContext)
Returns a
FlowExpressionParseUtil.FlowExpressionContext for the class classTree as seen at the
class declaration. |
static FlowExpressionParseUtil.FlowExpressionContext |
buildContextForLambda(LambdaExpressionTree lambdaTree,
TreePath path,
BaseContext checkerContext) |
static FlowExpressionParseUtil.FlowExpressionContext |
buildContextForMethodDeclaration(MethodTree methodDeclaration,
Tree enclosingTree,
BaseContext checkerContext)
Creates a
FlowExpressionParseUtil.FlowExpressionContext for the method declared in methodDeclaration . |
static FlowExpressionParseUtil.FlowExpressionContext |
buildContextForMethodDeclaration(MethodTree methodDeclaration,
TreePath currentPath,
BaseContext checkerContext)
Creates a
FlowExpressionParseUtil.FlowExpressionContext for the method declared in methodDeclaration . |
static FlowExpressionParseUtil.FlowExpressionContext |
buildContextForMethodDeclaration(MethodTree methodDeclaration,
TypeMirror enclosingType,
BaseContext checkerContext)
Creates a
FlowExpressionParseUtil.FlowExpressionContext for the method declared in methodDeclaration . |
static FlowExpressionParseUtil.FlowExpressionContext |
buildContextForMethodUse(MethodInvocationNode methodInvocation,
BaseContext checkerContext)
Returns a
FlowExpressionParseUtil.FlowExpressionContext for the method methodInvocation
(represented as a Node as seen at the method use (i.e., at a method call site). |
static FlowExpressionParseUtil.FlowExpressionContext |
buildContextForMethodUse(MethodInvocationTree methodInvocation,
BaseContext checkerContext)
Returns a
FlowExpressionParseUtil.FlowExpressionContext for the method methodInvocation
(represented as a MethodInvocationTree as seen at the method use (i.e., at a
method call site). |
static FlowExpressionParseUtil.FlowExpressionContext |
buildContextForNewClassUse(ObjectCreationNode n,
BaseContext checkerContext)
Returns a
FlowExpressionParseUtil.FlowExpressionContext for the constructor n (represented as a
Node as seen at the method use (i.e., at a method call site). |
FlowExpressionParseUtil.FlowExpressionContext |
copyAndSetUseLocalScope(boolean useLocalScope)
Returns a copy of the context that differs in that useLocalScope is set to the given
value.
|
FlowExpressionParseUtil.FlowExpressionContext |
copyAndUseOuterReceiver()
Returns a copy of the context that differs in that it uses the outer receiver as main
receiver (and also retains it as the outer receiver), and parsingMember is set to false.
|
FlowExpressionParseUtil.FlowExpressionContext |
copyChangeToParsingMemberOfReceiver(Receiver receiver)
Returns a copy of the context that differs in that it has a different receiver and
parsingMember is set to true.
|
String |
toStringDebug()
Format this object verbosely, with each line indented by 4 spaces but without a trailing
newline.
|
String |
toStringDebug(int indent)
Format this object verbosely, with each line indented by the given number of spaces but
without a trailing newline.
|
public final Receiver receiver
public final List<Receiver> arguments
public final Receiver outerReceiver
public final BaseContext checkerContext
public final boolean parsingMember
public final boolean useLocalScope
public FlowExpressionContext(Receiver receiver, List<Receiver> arguments, BaseContext checkerContext)
receiver
- used to replace "this" in a flow expression and used to resolve
identifiers in the flow expression with an implicit "this"arguments
- used to replace parameter references, e.g. #1, in flow expressions, null
if no argumentscheckerContext
- used to create Receiver
spublic static FlowExpressionParseUtil.FlowExpressionContext buildContextForMethodDeclaration(MethodTree methodDeclaration, Tree enclosingTree, BaseContext checkerContext)
FlowExpressionParseUtil.FlowExpressionContext
for the method declared in methodDeclaration
.methodDeclaration
- used translate parameter numbers in a flow expression to formal
parameters of the methodenclosingTree
- used to look up fields and as type of "this" in flow expressionscheckerContext
- use to build ReceivermethodDeclaration
public static FlowExpressionParseUtil.FlowExpressionContext buildContextForMethodDeclaration(MethodTree methodDeclaration, TypeMirror enclosingType, BaseContext checkerContext)
FlowExpressionParseUtil.FlowExpressionContext
for the method declared in methodDeclaration
.methodDeclaration
- used translate parameter numbers in a flow expression to formal
parameters of the methodenclosingType
- used to look up fields and as type of "this" in flow expressionscheckerContext
- use to build ReceivermethodDeclaration
public static FlowExpressionParseUtil.FlowExpressionContext buildContextForLambda(LambdaExpressionTree lambdaTree, TreePath path, BaseContext checkerContext)
public static FlowExpressionParseUtil.FlowExpressionContext buildContextForMethodDeclaration(MethodTree methodDeclaration, TreePath currentPath, BaseContext checkerContext)
FlowExpressionParseUtil.FlowExpressionContext
for the method declared in methodDeclaration
.methodDeclaration
- used translate parameter numbers in a flow expression to formal
parameters of the methodcurrentPath
- to find the enclosing class, which is used to look up fields and as
type of "this" in flow expressionscheckerContext
- use to build ReceivermethodDeclaration
public static FlowExpressionParseUtil.FlowExpressionContext buildContextForClassDeclaration(ClassTree classTree, BaseContext checkerContext)
FlowExpressionParseUtil.FlowExpressionContext
for the class classTree
as seen at the
class declaration.FlowExpressionParseUtil.FlowExpressionContext
for the class classTree
as seen at the
class declarationpublic static FlowExpressionParseUtil.FlowExpressionContext buildContextForMethodUse(MethodInvocationNode methodInvocation, BaseContext checkerContext)
FlowExpressionParseUtil.FlowExpressionContext
for the method methodInvocation
(represented as a Node
as seen at the method use (i.e., at a method call site).FlowExpressionParseUtil.FlowExpressionContext
for the method methodInvocation
public static FlowExpressionParseUtil.FlowExpressionContext buildContextForMethodUse(MethodInvocationTree methodInvocation, BaseContext checkerContext)
FlowExpressionParseUtil.FlowExpressionContext
for the method methodInvocation
(represented as a MethodInvocationTree
as seen at the method use (i.e., at a
method call site).FlowExpressionParseUtil.FlowExpressionContext
for the method methodInvocation
public static FlowExpressionParseUtil.FlowExpressionContext buildContextForNewClassUse(ObjectCreationNode n, BaseContext checkerContext)
FlowExpressionParseUtil.FlowExpressionContext
for the constructor n
(represented as a
Node
as seen at the method use (i.e., at a method call site).FlowExpressionParseUtil.FlowExpressionContext
for the constructor n
(represented as a
Node
as seen at the method use (i.e., at a method call site)public FlowExpressionParseUtil.FlowExpressionContext copyChangeToParsingMemberOfReceiver(Receiver receiver)
public FlowExpressionParseUtil.FlowExpressionContext copyAndUseOuterReceiver()
public FlowExpressionParseUtil.FlowExpressionContext copyAndSetUseLocalScope(boolean useLocalScope)
public String toStringDebug()
public String toStringDebug(int indent)
indent
- the number of spaces to indent the string representation of this