Package dev.cel.compiler
Class CelCompilerImpl
- java.lang.Object
-
- dev.cel.compiler.CelCompilerImpl
-
- All Implemented Interfaces:
CelChecker,EnvVisitable,CelCompiler,CelParser
@Immutable @Internal public final class CelCompilerImpl extends java.lang.Object implements CelCompiler, EnvVisitable
CelCompiler implementation which uses either the legacy or modernized CEL-Java stack to offer a stream-lined expression parse/type-check experience, via a singlecompilemethod.CEL Library Internals. Do Not Use. Consumers should use factories, such as
CelCompilerFactoryinstead to instantiate a compiler.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCelCompilerImpl.BuilderBuilder forCelCompilerImpl
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(EnvVisitor envVisitor)CelValidationResultcheck(CelAbstractSyntaxTree ast)Check the inputastfor type-agreement and return aCelValidationResult.static CelCompilerBuildernewBuilder(CelParserBuilder parserBuilder, CelCheckerBuilder checkerBuilder)Create a new builder for constructing aCelCompilerinstance.CelValidationResultparse(CelSource source)Parse the inputexpressionand return aCelValidationResult.CelValidationResultparse(java.lang.String expression, java.lang.String description)Parse the inputexpressionand return aCelValidationResult.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface dev.cel.compiler.CelCompiler
compile, compile
-
-
-
-
Method Detail
-
parse
public CelValidationResult parse(java.lang.String expression, java.lang.String description)
Description copied from interface:CelParserParse the inputexpressionand return aCelValidationResult.The
descriptionmay be used to help tailor error messages for the location where theexpressionoriginates, e.g. a file name or form UI element.Parse validates the syntax of an expression.
-
parse
public CelValidationResult parse(CelSource source)
Description copied from interface:CelParserParse the inputexpressionand return aCelValidationResult.The
descriptionmay be used to help tailor error messages for the location where theexpressionoriginates, e.g. a file name or form UI element.Parse validates the syntax of an expression.
-
check
public CelValidationResult check(CelAbstractSyntaxTree ast)
Description copied from interface:CelCheckerCheck the inputastfor type-agreement and return aCelValidationResult.Check validates the type-agreement of the parsed
CelAbstractSyntaxTree.- Specified by:
checkin interfaceCelChecker
-
accept
public void accept(EnvVisitor envVisitor)
- Specified by:
acceptin interfaceEnvVisitable
-
newBuilder
public static CelCompilerBuilder newBuilder(CelParserBuilder parserBuilder, CelCheckerBuilder checkerBuilder)
Create a new builder for constructing aCelCompilerinstance.By default,
CelOptions.DEFAULTare enabled, as is the CEL standard environment.
-
-