public static class JavaExpressionParseUtil.JavaExpressionContext extends Object
this and the parameter syntax, e.g. #1, should parse.| Modifier and Type | Field and Description |
|---|---|
List<JavaExpression> |
arguments
In a context for a method declaration or lambda, the formals.
|
SourceChecker |
checker
The checker.
|
JavaExpression |
receiver
The value of
this in this context. |
| Constructor and Description |
|---|
JavaExpressionContext(JavaExpression receiver,
List<JavaExpression> arguments,
SourceChecker checker)
Creates a context for parsing a Java expression.
|
JavaExpressionContext(JavaExpression receiver,
SourceChecker checker)
Creates a context for parsing a Java expression, with "null" for arguments.
|
public final JavaExpression receiver
this in this context.public final List<JavaExpression> arguments
public final SourceChecker checker
public JavaExpressionContext(JavaExpression receiver, SourceChecker checker)
receiver - used to replace "this" in a Java expression and used to resolve
identifiers in any Java expression with an implicit "this"checker - used to create JavaExpressionspublic JavaExpressionContext(JavaExpression receiver, List<JavaExpression> arguments, SourceChecker checker)
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 argumentschecker - used to create JavaExpressionspublic static JavaExpressionParseUtil.JavaExpressionContext buildContextForMethodDeclaration(MethodTree methodDeclaration, SourceChecker checker)
JavaExpressionParseUtil.JavaExpressionContext for the method declared in methodDeclaration.methodDeclaration - used to translate parameter numbers in a Java expression to
formal parameters of the methodchecker - used to build JavaExpressionmethodDeclarationpublic static JavaExpressionParseUtil.JavaExpressionContext buildContextForLambda(LambdaExpressionTree lambdaTree, TreePath path, SourceChecker checker)
JavaExpressionParseUtil.JavaExpressionContext for the given lambda.lambdaTree - a lambdapath - the path to the lambdachecker - used to build JavaExpressionlambdaTreepublic static JavaExpressionParseUtil.JavaExpressionContext buildContextForClassDeclaration(ClassTree classTree, SourceChecker checker)
JavaExpressionParseUtil.JavaExpressionContext for the class classTree as seen at the
class declaration.classTree - a classchecker - used to build JavaExpressionJavaExpressionParseUtil.JavaExpressionContext for the class classTree as seen at the
class declarationpublic static JavaExpressionParseUtil.JavaExpressionContext buildContextForMethodUse(MethodInvocationNode methodInvocation, SourceChecker checker)
JavaExpressionParseUtil.JavaExpressionContext for the method called by methodInvocation, as seen at the method use (i.e., at the call site).methodInvocation - a method invocationchecker - the javac components to useJavaExpressionParseUtil.JavaExpressionContext for the method methodInvocationpublic static JavaExpressionParseUtil.JavaExpressionContext buildContextForMethodUse(MethodInvocationTree methodInvocation, SourceChecker checker)
JavaExpressionParseUtil.JavaExpressionContext for the method called by methodInvocation, as seen at the method use (i.e., at the call site).methodInvocation - a method invocationchecker - the javac components to useJavaExpressionParseUtil.JavaExpressionContext for the method methodInvocationpublic static JavaExpressionParseUtil.JavaExpressionContext buildContextForNewClassUse(ObjectCreationNode n, SourceChecker checker)
JavaExpressionParseUtil.JavaExpressionContext for the constructor n (represented as a
Node as seen at the constructor use (i.e., at a "new" expression).n - an object creation nodechecker - the checkerJavaExpressionParseUtil.JavaExpressionContext for the constructor n (represented as a
Node as seen at the constructor use (i.e., at a "new" expression)public String toStringDebug()