Interface CelParserBuilder

  • All Known Implementing Classes:
    CelParserImpl.Builder

    public interface CelParserBuilder
    Interface for building an instance of CelParser
    • Method Detail

      • getOptions

        @CanIgnoreReturnValue
        CelOptions getOptions()
        Retrieves the currently configured CelOptions for the parser.
      • setStandardMacros

        @CanIgnoreReturnValue
        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.
      • setStandardMacros

        @CanIgnoreReturnValue
        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.
      • addMacros

        @CanIgnoreReturnValue
        CelParserBuilder addMacros​(CelMacro... macros)
        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 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.

      • addMacros

        @CanIgnoreReturnValue
        CelParserBuilder addMacros​(java.lang.Iterable<CelMacro> macros)
        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 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.

      • addLibraries

        @CanIgnoreReturnValue
        CelParserBuilder addLibraries​(java.lang.Iterable<? extends CelParserLibrary> libraries)
        Adds a collection of libraries for parsing
      • build

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