Package dev.cel.optimizer
Interface CelOptimizer
-
public interface CelOptimizerPublic interface for optimizing an AST.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CelAbstractSyntaxTreeoptimize(CelAbstractSyntaxTree ast)Performs custom optimization of the provided AST.
-
-
-
Method Detail
-
optimize
CelAbstractSyntaxTree optimize(CelAbstractSyntaxTree ast) throws CelOptimizationException
Performs custom optimization of the provided AST.This invokes all the AST optimizers present in this CelOptimizer instance via
CelOptimizerBuilder.addAstOptimizers(dev.cel.optimizer.CelAstOptimizer...)in their added order. Any exceptions thrown within the AST optimizer will be propagated to the caller and will abort the optimization process.Note that the produced expression string from unparsing an optimized AST will likely not be equal to the original expression.
- Parameters:
ast- A type-checked AST.- Throws:
CelOptimizationException- If any failures occur during any of the AST optimization pass.
-
-