Interface CelRuntimeBuilder
-
- All Known Implementing Classes:
CelRuntimeLegacyImpl.Builder
public interface CelRuntimeBuilderInterface for building an instance of CelRuntime
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CelRuntimeBuilderaddFileTypes(DescriptorProtos.FileDescriptorSet fileDescriptorSet)Add all of theDescriptors.FileDescriptors in aFileDescriptorSetto the use for type-checking, and for object creation at interpretation time.CelRuntimeBuilderaddFileTypes(Descriptors.FileDescriptor... fileDescriptors)AddDescriptors.FileDescriptors to the use for type-checking, and for object creation at interpretation time.CelRuntimeBuilderaddFileTypes(java.lang.Iterable<Descriptors.FileDescriptor> fileDescriptors)AddDescriptors.FileDescriptors to the use for type-checking, and for object creation at interpretation time.CelRuntimeBuilderaddFunctionBindings(CelRuntime.CelFunctionBinding... bindings)Add one or moreCelRuntime.CelFunctionBindingobjects to the CEL runtime.CelRuntimeBuilderaddFunctionBindings(java.lang.Iterable<CelRuntime.CelFunctionBinding> bindings)Bind a collection ofCelRuntime.CelFunctionBindingobjects to the runtime.CelRuntimeBuilderaddLibraries(CelRuntimeLibrary... libraries)Adds one or more libraries for runtime.CelRuntimeBuilderaddLibraries(java.lang.Iterable<? extends CelRuntimeLibrary> libraries)Adds a collection of libraries for runtime.CelRuntimeBuilderaddMessageTypes(Descriptors.Descriptor... descriptors)Add messageDescriptors.Descriptors to the builder for type-checking and object creation at interpretation time.CelRuntimeBuilderaddMessageTypes(java.lang.Iterable<Descriptors.Descriptor> descriptors)Add messageDescriptors.Descriptors to the use for type-checking and object creation at interpretation time.CelRuntimebuild()Build a new instance of theCelRuntime.CelRuntimeBuildersetExtensionRegistry(ExtensionRegistry extensionRegistry)Sets a proto ExtensionRegistry to assist with unpacking Any messages containing a proto2 extension field.CelRuntimeBuildersetOptions(CelOptions options)Set theCelOptionsused to enable fixes and features for this CEL instance.CelRuntimeBuildersetStandardEnvironmentEnabled(boolean value)Enable or disable the standard CEL library functions and variables.CelRuntimeBuildersetTypeFactory(java.util.function.Function<java.lang.String,Message.Builder> typeFactory)Set a custom type factory for the runtime.CelRuntimeBuildersetValueProvider(CelValueProvider celValueProvider)Sets thecelValueProviderfor resolving values during evaluation.
-
-
-
Method Detail
-
setOptions
@CanIgnoreReturnValue CelRuntimeBuilder setOptions(CelOptions options)
Set theCelOptionsused to enable fixes and features for this CEL instance.
-
addFunctionBindings
@CanIgnoreReturnValue CelRuntimeBuilder addFunctionBindings(CelRuntime.CelFunctionBinding... bindings)
Add one or moreCelRuntime.CelFunctionBindingobjects to the CEL runtime.Functions with duplicate overload ids will be replaced in favor of the new overload.
-
addFunctionBindings
@CanIgnoreReturnValue CelRuntimeBuilder addFunctionBindings(java.lang.Iterable<CelRuntime.CelFunctionBinding> bindings)
Bind a collection ofCelRuntime.CelFunctionBindingobjects to the runtime.Functions with duplicate overload ids will be replaced in favor of the new overload.
-
addMessageTypes
@CanIgnoreReturnValue CelRuntimeBuilder addMessageTypes(Descriptors.Descriptor... descriptors)
Add messageDescriptors.Descriptors to the builder for type-checking and object creation at interpretation time.Note, it is valid to combine type factory methods within the runtime. Only the options which have been configured will be used. The type creation search order is as follows:
-
Custom type factory (
setTypeFactory(java.util.function.Function<java.lang.String, com.google.protobuf.Message.Builder>)) Custom descriptor set {#addMessageTypes)
-
addMessageTypes
@CanIgnoreReturnValue CelRuntimeBuilder addMessageTypes(java.lang.Iterable<Descriptors.Descriptor> descriptors)
Add messageDescriptors.Descriptors to the use for type-checking and object creation at interpretation time.Note, it is valid to combine type factory methods within the runtime. Only the options which have been configured will be used. The type creation search order is as follows:
-
Custom type factory (
setTypeFactory(java.util.function.Function<java.lang.String, com.google.protobuf.Message.Builder>)) Custom descriptor set {#addMessageTypes)
-
addFileTypes
@CanIgnoreReturnValue CelRuntimeBuilder addFileTypes(Descriptors.FileDescriptor... fileDescriptors)
AddDescriptors.FileDescriptors to the use for type-checking, and for object creation at interpretation time.Note, it is valid to combine type factory methods within the runtime. Only the options which have been configured will be used. The type creation search order is as follows:
-
Custom type factory (
setTypeFactory(java.util.function.Function<java.lang.String, com.google.protobuf.Message.Builder>)) Custom descriptor set {addMessageTypes(com.google.protobuf.Descriptors.Descriptor...))
-
addFileTypes
@CanIgnoreReturnValue CelRuntimeBuilder addFileTypes(java.lang.Iterable<Descriptors.FileDescriptor> fileDescriptors)
AddDescriptors.FileDescriptors to the use for type-checking, and for object creation at interpretation time.Note, it is valid to combine type factory methods within the runtime. Only the options which have been configured will be used. The type creation search order is as follows:
-
Custom type factory (
setTypeFactory(java.util.function.Function<java.lang.String, com.google.protobuf.Message.Builder>)) Custom descriptor set {addMessageTypes(com.google.protobuf.Descriptors.Descriptor...))
-
addFileTypes
@CanIgnoreReturnValue CelRuntimeBuilder addFileTypes(DescriptorProtos.FileDescriptorSet fileDescriptorSet)
Add all of theDescriptors.FileDescriptors in aFileDescriptorSetto the use for type-checking, and for object creation at interpretation time.Note, it is valid to combine type factory methods within the runtime. Only the options which have been configured will be used. The type creation search order is as follows:
-
Custom type factory (
setTypeFactory(java.util.function.Function<java.lang.String, com.google.protobuf.Message.Builder>)) Custom descriptor set {addMessageTypes(com.google.protobuf.Descriptors.Descriptor...))
-
setTypeFactory
@CanIgnoreReturnValue CelRuntimeBuilder setTypeFactory(java.util.function.Function<java.lang.String,Message.Builder> typeFactory)
Set a custom type factory for the runtime.Note: it is valid to combine type factory methods within the runtime. Only the options which have been configured will be used.
The type creation search order is as follows:
-
Custom type factory (
#setTypeFactory) Custom descriptor set {addMessageTypes(com.google.protobuf.Descriptors.Descriptor...))
-
setValueProvider
@CanIgnoreReturnValue CelRuntimeBuilder setValueProvider(CelValueProvider celValueProvider)
Sets thecelValueProviderfor resolving values during evaluation. The provided value provider will be used first before falling back to the built-inProtoMessageValueProviderfor resolving protobuf messages.Note
CelOptions.enableCelValue()must be enabled or this method will be a no-op.
-
setStandardEnvironmentEnabled
@CanIgnoreReturnValue CelRuntimeBuilder setStandardEnvironmentEnabled(boolean value)
Enable or disable the standard CEL library functions and variables.
-
addLibraries
@CanIgnoreReturnValue CelRuntimeBuilder addLibraries(CelRuntimeLibrary... libraries)
Adds one or more libraries for runtime.
-
addLibraries
@CanIgnoreReturnValue CelRuntimeBuilder addLibraries(java.lang.Iterable<? extends CelRuntimeLibrary> libraries)
Adds a collection of libraries for runtime.
-
setExtensionRegistry
@CanIgnoreReturnValue CelRuntimeBuilder setExtensionRegistry(ExtensionRegistry extensionRegistry)
Sets a proto ExtensionRegistry to assist with unpacking Any messages containing a proto2 extension field.
-
build
@CheckReturnValue CelRuntime build()
Build a new instance of theCelRuntime.
-
-