Class JavaxElPolicyExecutor.Builder

java.lang.Object
io.helidon.security.abac.policy.el.JavaxElPolicyExecutor.Builder
All Implemented Interfaces:
Builder<JavaxElPolicyExecutor.Builder,JavaxElPolicyExecutor>, Supplier<JavaxElPolicyExecutor>
Enclosing class:
JavaxElPolicyExecutor

public static final class JavaxElPolicyExecutor.Builder extends Object implements Builder<JavaxElPolicyExecutor.Builder,JavaxElPolicyExecutor>
A fluent API builder for JavaxElPolicyExecutor.
  • Method Details

    • build

      public JavaxElPolicyExecutor build()
      Description copied from interface: Builder
      Build the instance from this builder.
      Specified by:
      build in interface Builder<JavaxElPolicyExecutor.Builder,JavaxElPolicyExecutor>
      Returns:
      instance of the built type
    • expressionFactory

      public JavaxElPolicyExecutor.Builder expressionFactory(jakarta.el.ExpressionFactory factory)
      Configure a specific expression factory to use with this executor. If this method is not called, the executor uses default expression factory (if one is on the classpath).
      Parameters:
      factory - factory to use
      Returns:
      updated builder instance
    • addMethod

      public JavaxElPolicyExecutor.Builder addMethod(String localName, Method method)
      Add a custom method to be available in expressions without a prefix. This method must be a static method.
      Parameters:
      localName - name to call this function in an expression
      method - method to invoke (may have parameters - these can be passed from the script)
      Returns:
      updated builder instance
      See Also:
    • addMethod

      public JavaxElPolicyExecutor.Builder addMethod(String prefix, String localName, Method method)
      Add a custom method to be available in expressions. This method must be a static method.

      Example
      prefix: fun
      localName: inRole
      method: public static boolean isSubjectInRole(Subject subject, String roleName)
      expression: "${fun:inRole(user, "some_role"}"

      Parameters:
      prefix - prefix to use before the name in an expression
      localName - name to call this function in an expression
      method - method to invoke (may have parameters - these can be passed from the script)
      Returns:
      updated builder instance
    • config

      public JavaxElPolicyExecutor.Builder config(Config config)
      Updated builder from configuration.
      Parameters:
      config - configuration to update from
      Returns:
      updated builder instance