Interface CelCheckerBuilder

  • All Known Implementing Classes:
    CelCheckerLegacyImpl.Builder

    public interface CelCheckerBuilder
    Interface for building an instance of CelChecker
    • Method Detail

      • setOptions

        @CanIgnoreReturnValue
        CelCheckerBuilder setOptions​(CelOptions options)
        Set the CelOptions used to enable fixes and features for this CEL instances.
      • setContainer

        @CanIgnoreReturnValue
        CelCheckerBuilder setContainer​(java.lang.String container)
        Set the container name to use as the namespace for resolving CEL expression variables and functions.
      • addDeclarations

        @CanIgnoreReturnValue
        CelCheckerBuilder addDeclarations​(Decl... declarations)
        Add variable and function declarations to the CEL environment.
      • addDeclarations

        @CanIgnoreReturnValue
        CelCheckerBuilder addDeclarations​(java.lang.Iterable<Decl> declarations)
        Add variable and function declarations to the CEL environment.
      • addFunctionDeclarations

        @CanIgnoreReturnValue
        CelCheckerBuilder addFunctionDeclarations​(CelFunctionDecl... celFunctionDecls)
        Add function declaration CelFunctionDecl to the CEL environment.
      • addFunctionDeclarations

        @CanIgnoreReturnValue
        CelCheckerBuilder addFunctionDeclarations​(java.lang.Iterable<CelFunctionDecl> celFunctionDecls)
        Add function declaration CelFunctionDecl to the CEL environment.
      • addVarDeclarations

        @CanIgnoreReturnValue
        CelCheckerBuilder addVarDeclarations​(CelVarDecl... celVarDecls)
        Add variable declaration CelVarDecl to the CEL environment.
      • addVarDeclarations

        @CanIgnoreReturnValue
        CelCheckerBuilder addVarDeclarations​(java.lang.Iterable<CelVarDecl> celVarDecls)
        Add variable declaration CelVarDecl to the CEL environment.
      • setResultType

        @CanIgnoreReturnValue
        CelCheckerBuilder setResultType​(CelType resultType)
        Set the expected resultType for the type-checked expression.
      • setProtoResultType

        @CanIgnoreReturnValue
        CelCheckerBuilder setProtoResultType​(Type resultType)
        Set the expected resultType in proto format described in checked.proto for the type-checked expression.
      • setTypeProvider

        @CanIgnoreReturnValue
        CelCheckerBuilder setTypeProvider​(CelTypeProvider celTypeProvider)
        Set the celTypeProvider for use with type-checking expressions.
      • addMessageTypes

        @CanIgnoreReturnValue
        CelCheckerBuilder addMessageTypes​(com.google.protobuf.Descriptors.Descriptor... descriptors)
        Add message Descriptors.Descriptors to the use for type-checking and object creation at interpretation time.
      • addMessageTypes

        @CanIgnoreReturnValue
        CelCheckerBuilder addMessageTypes​(java.lang.Iterable<com.google.protobuf.Descriptors.Descriptor> descriptors)
        Add message Descriptors.Descriptors to the use for type-checking and object creation at interpretation time.
      • addFileTypes

        @CanIgnoreReturnValue
        CelCheckerBuilder addFileTypes​(com.google.protobuf.Descriptors.FileDescriptor... fileDescriptors)
        Add Descriptors.FileDescriptors to the use for type-checking, and for object creation at interpretation time.
      • addFileTypes

        @CanIgnoreReturnValue
        CelCheckerBuilder addFileTypes​(java.lang.Iterable<com.google.protobuf.Descriptors.FileDescriptor> fileDescriptors)
        Add Descriptors.FileDescriptors to the use for type-checking, and for object creation at interpretation time.
      • addFileTypes

        @CanIgnoreReturnValue
        CelCheckerBuilder addFileTypes​(com.google.protobuf.DescriptorProtos.FileDescriptorSet fileDescriptorSet)
        Add all of the Descriptors.FileDescriptors in a FileDescriptorSet to the use for type-checking, and for object creation at interpretation time.
      • setStandardEnvironmentEnabled

        @CanIgnoreReturnValue
        CelCheckerBuilder setStandardEnvironmentEnabled​(boolean value)
        Enable or disable the standard CEL library functions and variables
      • setStandardDeclarations

        @CanIgnoreReturnValue
        CelCheckerBuilder setStandardDeclarations​(CelStandardDeclarations standardDeclarations)
        Override the standard declarations for the type-checker. This can be used to subset the standard environment to only expose the desired declarations to the type-checker. setStandardEnvironmentEnabled(boolean) must be set to false for this to take effect.
      • addLibraries

        @CanIgnoreReturnValue
        CelCheckerBuilder addLibraries​(java.lang.Iterable<? extends CelCheckerLibrary> libraries)
        Adds a collection of libraries for parsing and type-checking.
      • build

        @CheckReturnValue
        CelChecker build()
        Build a new instance of the CelChecker.