public static class JavaExpressionParseUtil.JavaExpressionContext extends Object
@A(E)
, the context is the program element that is annotated by @A(E)
.Modifier and Type | Field and Description |
---|---|
List<JavaExpression> |
arguments
In a context for a method declaration or lambda, the formals.
|
BaseContext |
checkerContext |
JavaExpression |
outerReceiver |
boolean |
parsingMember
Whether or not the FlowExpressionParser is parsing the "member" part of a member select.
|
JavaExpression |
receiver |
boolean |
useLocalScope
Whether the TreePath should be used to find identifiers.
|
Constructor and Description |
---|
JavaExpressionContext(JavaExpression receiver,
List<JavaExpression> arguments,
BaseContext checkerContext)
Creates a context for parsing a Java expression.
|
Modifier and Type | Method and Description |
---|---|
static JavaExpressionParseUtil.JavaExpressionContext |
buildContextForClassDeclaration(ClassTree classTree,
BaseContext checkerContext)
Returns a
JavaExpressionParseUtil.JavaExpressionContext for the class classTree as seen at the
class declaration. |
static JavaExpressionParseUtil.JavaExpressionContext |
buildContextForLambda(LambdaExpressionTree lambdaTree,
TreePath path,
BaseContext checkerContext)
Creates a
JavaExpressionParseUtil.JavaExpressionContext for the given lambda. |
static JavaExpressionParseUtil.JavaExpressionContext |
buildContextForMethodDeclaration(MethodTree methodDeclaration,
Tree enclosingTree,
BaseContext checkerContext)
Creates a
JavaExpressionParseUtil.JavaExpressionContext for the method declared in methodDeclaration . |
static JavaExpressionParseUtil.JavaExpressionContext |
buildContextForMethodDeclaration(MethodTree methodDeclaration,
TreePath currentPath,
BaseContext checkerContext)
Creates a
JavaExpressionParseUtil.JavaExpressionContext for the method declared in methodDeclaration . |
static JavaExpressionParseUtil.JavaExpressionContext |
buildContextForMethodDeclaration(MethodTree methodDeclaration,
TypeMirror enclosingType,
BaseContext checkerContext)
Creates a
JavaExpressionParseUtil.JavaExpressionContext for the method declared in methodDeclaration . |
static JavaExpressionParseUtil.JavaExpressionContext |
buildContextForMethodUse(MethodInvocationNode methodInvocation,
BaseContext checkerContext)
Returns a
JavaExpressionParseUtil.JavaExpressionContext for the method called by methodInvocation , as seen at the method use (i.e., at the call site). |
static JavaExpressionParseUtil.JavaExpressionContext |
buildContextForMethodUse(MethodInvocationTree methodInvocation,
BaseContext checkerContext)
Returns a
JavaExpressionParseUtil.JavaExpressionContext for the method called by methodInvocation , as seen at the method use (i.e., at the call site). |
static JavaExpressionParseUtil.JavaExpressionContext |
buildContextForNewClassUse(ObjectCreationNode n,
BaseContext checkerContext)
Returns a
JavaExpressionParseUtil.JavaExpressionContext for the constructor n (represented as a
Node as seen at the method use (i.e., at a method call site). |
JavaExpressionParseUtil.JavaExpressionContext |
copyAndSetUseLocalScope(boolean useLocalScope)
Returns a copy of the context that differs in that useLocalScope is set to the given
value.
|
JavaExpressionParseUtil.JavaExpressionContext |
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.
|
JavaExpressionParseUtil.JavaExpressionContext |
copyChangeToParsingMemberOfReceiver(JavaExpression 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, on multiple lines but without a trailing newline.
|
public final JavaExpression receiver
public final List<JavaExpression> arguments
public final JavaExpression outerReceiver
public final BaseContext checkerContext
public final boolean parsingMember
public final boolean useLocalScope
public JavaExpressionContext(JavaExpression receiver, List<JavaExpression> arguments, BaseContext checkerContext)
receiver
- used to replace "this" in a Java expression and used to resolve
identifiers in any Java expression with an implicit "this"arguments
- used to replace parameter references, e.g. #1, in Java expressions, null
if no argumentscheckerContext
- used to create JavaExpression
spublic static JavaExpressionParseUtil.JavaExpressionContext buildContextForMethodDeclaration(MethodTree methodDeclaration, Tree enclosingTree, BaseContext checkerContext)
JavaExpressionParseUtil.JavaExpressionContext
for the method declared in methodDeclaration
.methodDeclaration
- used to translate parameter numbers in a Java expression to
formal parameters of the methodenclosingTree
- used to look up fields and as the type of "this" in Java expressionscheckerContext
- used to build JavaExpressionmethodDeclaration
public static JavaExpressionParseUtil.JavaExpressionContext buildContextForMethodDeclaration(MethodTree methodDeclaration, TreePath currentPath, BaseContext checkerContext)
JavaExpressionParseUtil.JavaExpressionContext
for the method declared in methodDeclaration
.methodDeclaration
- used to translate parameter numbers in a Java 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 Java expressionscheckerContext
- used to build JavaExpressionmethodDeclaration
public static JavaExpressionParseUtil.JavaExpressionContext buildContextForMethodDeclaration(MethodTree methodDeclaration, TypeMirror enclosingType, BaseContext checkerContext)
JavaExpressionParseUtil.JavaExpressionContext
for the method declared in methodDeclaration
.methodDeclaration
- used to translate parameter numbers in a Java expression to
formal parameters of the methodenclosingType
- used to look up fields and as type of "this" in Java expressionscheckerContext
- used to build JavaExpressionmethodDeclaration
public static JavaExpressionParseUtil.JavaExpressionContext buildContextForLambda(LambdaExpressionTree lambdaTree, TreePath path, BaseContext checkerContext)
JavaExpressionParseUtil.JavaExpressionContext
for the given lambda.lambdaTree
- a lambdapath
- the path to the lambdacheckerContext
- used to build JavaExpressionlambdaTree
public static JavaExpressionParseUtil.JavaExpressionContext buildContextForClassDeclaration(ClassTree classTree, BaseContext checkerContext)
JavaExpressionParseUtil.JavaExpressionContext
for the class classTree
as seen at the
class declaration.JavaExpressionParseUtil.JavaExpressionContext
for the class classTree
as seen at the
class declarationpublic static JavaExpressionParseUtil.JavaExpressionContext buildContextForMethodUse(MethodInvocationNode methodInvocation, BaseContext checkerContext)
JavaExpressionParseUtil.JavaExpressionContext
for the method called by methodInvocation
, as seen at the method use (i.e., at the call site).JavaExpressionParseUtil.JavaExpressionContext
for the method methodInvocation
public static JavaExpressionParseUtil.JavaExpressionContext buildContextForMethodUse(MethodInvocationTree methodInvocation, BaseContext checkerContext)
JavaExpressionParseUtil.JavaExpressionContext
for the method called by methodInvocation
, as seen at the method use (i.e., at the call site).methodInvocation
- a method invocationcheckerContext
- the javac components to useJavaExpressionParseUtil.JavaExpressionContext
for the method methodInvocation
public static JavaExpressionParseUtil.JavaExpressionContext buildContextForNewClassUse(ObjectCreationNode n, BaseContext checkerContext)
JavaExpressionParseUtil.JavaExpressionContext
for the constructor n
(represented as a
Node
as seen at the method use (i.e., at a method call site).JavaExpressionParseUtil.JavaExpressionContext
for the constructor n
(represented as a
Node
as seen at the method use (i.e., at a method call site)public JavaExpressionParseUtil.JavaExpressionContext copyChangeToParsingMemberOfReceiver(JavaExpression receiver)
public JavaExpressionParseUtil.JavaExpressionContext copyAndUseOuterReceiver()
public JavaExpressionParseUtil.JavaExpressionContext copyAndSetUseLocalScope(boolean useLocalScope)
public String toStringDebug()