Class CelParserImpl.Builder
- java.lang.Object
-
- dev.cel.parser.CelParserImpl.Builder
-
- All Implemented Interfaces:
CelParserBuilder
- Enclosing class:
- CelParserImpl
public static final class CelParserImpl.Builder extends java.lang.Object implements CelParserBuilder
Builder forCelParserImpl.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CelParserBuilderaddLibraries(CelParserLibrary... libraries)Adds one or more libraries for parsingCelParserBuilderaddLibraries(java.lang.Iterable<? extends CelParserLibrary> libraries)Adds a collection of libraries for parsingCelParserBuilderaddMacros(CelMacro... macros)Registers the given macros, replacing any previous macros with the same key.CelParserBuilderaddMacros(java.lang.Iterable<CelMacro> macros)Registers the given macros, replacing any previous macros with the same key.CelParserImplbuild()Build a new instance of theCelParser.CelOptionsgetOptions()Retrieves the currently configuredCelOptionsfor the parser.CelParserImpl.BuildersetOptions(CelOptions options)Configures theCelOptionsused to enable fixes within the parser.CelParserBuildersetStandardMacros(CelStandardMacro... macros)Sets the macro set defined as part of CEL standard library for the parser, replacing the macros from any prior call.CelParserBuildersetStandardMacros(java.lang.Iterable<CelStandardMacro> macros)Sets the macro set defined as part of CEL standard library for the parser, replacing the macros from any prior call.
-
-
-
Method Detail
-
setStandardMacros
public CelParserBuilder setStandardMacros(CelStandardMacro... macros)
Description copied from interface:CelParserBuilderSets the macro set defined as part of CEL standard library for the parser, replacing the macros from any prior call.- Specified by:
setStandardMacrosin interfaceCelParserBuilder
-
setStandardMacros
public CelParserBuilder setStandardMacros(java.lang.Iterable<CelStandardMacro> macros)
Description copied from interface:CelParserBuilderSets the macro set defined as part of CEL standard library for the parser, replacing the macros from any prior call.- Specified by:
setStandardMacrosin interfaceCelParserBuilder
-
addMacros
public CelParserBuilder addMacros(CelMacro... macros)
Description copied from interface:CelParserBuilderRegisters the given macros, replacing any previous macros with the same key.Use this to register a set of user-defined custom macro implementation for the parser. For registering macros defined as part of CEL standard library, use
CelParserBuilder.setStandardMacros(dev.cel.parser.CelStandardMacro...)instead.Custom macros should not use the same function names as the ones found in
CelStandardMacro(ex: has, all, exists, etc.). Build method will throw if both standard macros and custom macros are set with the same name.- Specified by:
addMacrosin interfaceCelParserBuilder
-
addMacros
public CelParserBuilder addMacros(java.lang.Iterable<CelMacro> macros)
Description copied from interface:CelParserBuilderRegisters the given macros, replacing any previous macros with the same key.Use this to register a set of user-defined custom macro implementation for the parser. For registering macros defined as part of CEL standard library, use
CelParserBuilder.setStandardMacros(dev.cel.parser.CelStandardMacro...)instead.Custom macros should not use the same function names as the ones found in
CelStandardMacro(ex: has, all, exists, etc.). Build method will throw if both standard macros and custom macros are set with the same name.- Specified by:
addMacrosin interfaceCelParserBuilder
-
addLibraries
public CelParserBuilder addLibraries(CelParserLibrary... libraries)
Description copied from interface:CelParserBuilderAdds one or more libraries for parsing- Specified by:
addLibrariesin interfaceCelParserBuilder
-
addLibraries
public CelParserBuilder addLibraries(java.lang.Iterable<? extends CelParserLibrary> libraries)
Description copied from interface:CelParserBuilderAdds a collection of libraries for parsing- Specified by:
addLibrariesin interfaceCelParserBuilder
-
setOptions
public CelParserImpl.Builder setOptions(CelOptions options)
Description copied from interface:CelParserBuilderConfigures theCelOptionsused to enable fixes within the parser.- Specified by:
setOptionsin interfaceCelParserBuilder
-
getOptions
public CelOptions getOptions()
Description copied from interface:CelParserBuilderRetrieves the currently configuredCelOptionsfor the parser.- Specified by:
getOptionsin interfaceCelParserBuilder
-
build
@CheckReturnValue public CelParserImpl build()
Description copied from interface:CelParserBuilderBuild a new instance of theCelParser.- Specified by:
buildin interfaceCelParserBuilder
-
-