public class OptimizerVisitor
extends ClassCodeExpressionTransformer
Visitor to produce several optimizations:
| Constructor and description |
|---|
OptimizerVisitor(CompilationUnit cu)Creates an optimizer visitor. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected SourceUnit |
getSourceUnit()Returns the source unit currently being optimized. |
|
public Expression |
transform(Expression exp)Rewrites constant expressions that can be cached in synthetic fields. |
|
public void |
visitClass(ClassNode node, SourceUnit source)Applies optimizer rewrites to the supplied class. |
|
public void |
visitClosureExpression(ClosureExpression expression)Leaves closure bodies untouched so constant caching does not leak into closure classes. |
Creates an optimizer visitor.
cu - the owning compilation unitReturns the source unit currently being optimized.
Rewrites constant expressions that can be cached in synthetic fields.
exp - the expression to transformApplies optimizer rewrites to the supplied class.
node - the class to optimizesource - the source unit containing the classLeaves closure bodies untouched so constant caching does not leak into closure classes.
expression - the closure expression being skippedCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.