public class JavaExpressionOptimizer extends JavaExpressionConverter
ValueAnnotatedTypeFactory
, this implementation replaces any expression that the factory has an
exact value for, and does a small (not exhaustive) amount of constant-folding as well. If the
factory is some other factory, less optimization occurs.Constructor and Description |
---|
JavaExpressionOptimizer(AnnotatedTypeFactory factory)
Creates a JavaExpressionOptimizer.
|
Modifier and Type | Method and Description |
---|---|
protected JavaExpression |
visitFieldAccess(FieldAccess fieldAccessExpr,
Void unused)
Visit a
FieldAccess . |
protected JavaExpression |
visitLocalVariable(LocalVariable localVarExpr,
Void unused)
Visit a
LocalVariable . |
protected JavaExpression |
visitMethodCall(MethodCall methodCallExpr,
Void unused)
Visit a
MethodCall . |
convert, convert, visitArrayAccess, visitArrayCreation, visitBinaryOperation, visitClassName, visitFormalParameter, visitThisReference, visitUnaryOperation, visitUnknown, visitValueLiteral
visit
public JavaExpressionOptimizer(AnnotatedTypeFactory factory)
factory
- an annotated type factoryprotected JavaExpression visitFieldAccess(FieldAccess fieldAccessExpr, Void unused)
JavaExpressionVisitor
FieldAccess
.visitFieldAccess
in class JavaExpressionConverter
fieldAccessExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit methodfieldAccessExpr
protected JavaExpression visitLocalVariable(LocalVariable localVarExpr, Void unused)
JavaExpressionVisitor
LocalVariable
.visitLocalVariable
in class JavaExpressionConverter
localVarExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit methodlocalVarExpr
protected JavaExpression visitMethodCall(MethodCall methodCallExpr, Void unused)
JavaExpressionVisitor
MethodCall
.visitMethodCall
in class JavaExpressionConverter
methodCallExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit methodmethodCallExpr