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 CelParserBuilder
addLibraries(CelParserLibrary... libraries)
Adds one or more libraries for parsingCelParserBuilder
addLibraries(java.lang.Iterable<? extends CelParserLibrary> libraries)
Adds a collection of libraries for parsingCelParserBuilder
addMacros(CelMacro... macros)
Registers the given macros, replacing any previous macros with the same key.CelParserBuilder
addMacros(java.lang.Iterable<CelMacro> macros)
Registers the given macros, replacing any previous macros with the same key.CelParserImpl
build()
Build a new instance of theCelParser
.CelOptions
getOptions()
Retrieves the currently configuredCelOptions
for the parser.CelParserImpl.Builder
setOptions(CelOptions options)
Configures theCelOptions
used to enable fixes within the parser.CelParserBuilder
setStandardMacros(CelStandardMacro... macros)
Sets the macro set defined as part of CEL standard library for the parser, replacing the macros from any prior call.CelParserBuilder
setStandardMacros(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:CelParserBuilder
Sets the macro set defined as part of CEL standard library for the parser, replacing the macros from any prior call.- Specified by:
setStandardMacros
in interfaceCelParserBuilder
-
setStandardMacros
public CelParserBuilder setStandardMacros(java.lang.Iterable<CelStandardMacro> macros)
Description copied from interface:CelParserBuilder
Sets the macro set defined as part of CEL standard library for the parser, replacing the macros from any prior call.- Specified by:
setStandardMacros
in interfaceCelParserBuilder
-
addMacros
public CelParserBuilder addMacros(CelMacro... macros)
Description copied from interface:CelParserBuilder
Registers 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:
addMacros
in interfaceCelParserBuilder
-
addMacros
public CelParserBuilder addMacros(java.lang.Iterable<CelMacro> macros)
Description copied from interface:CelParserBuilder
Registers 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:
addMacros
in interfaceCelParserBuilder
-
addLibraries
public CelParserBuilder addLibraries(CelParserLibrary... libraries)
Description copied from interface:CelParserBuilder
Adds one or more libraries for parsing- Specified by:
addLibraries
in interfaceCelParserBuilder
-
addLibraries
public CelParserBuilder addLibraries(java.lang.Iterable<? extends CelParserLibrary> libraries)
Description copied from interface:CelParserBuilder
Adds a collection of libraries for parsing- Specified by:
addLibraries
in interfaceCelParserBuilder
-
setOptions
public CelParserImpl.Builder setOptions(CelOptions options)
Description copied from interface:CelParserBuilder
Configures theCelOptions
used to enable fixes within the parser.- Specified by:
setOptions
in interfaceCelParserBuilder
-
getOptions
public CelOptions getOptions()
Description copied from interface:CelParserBuilder
Retrieves the currently configuredCelOptions
for the parser.- Specified by:
getOptions
in interfaceCelParserBuilder
-
build
@CheckReturnValue public CelParserImpl build()
Description copied from interface:CelParserBuilder
Build a new instance of theCelParser
.- Specified by:
build
in interfaceCelParserBuilder
-
-