Class JavaxElPolicyExecutor.Builder
- java.lang.Object
-
- io.helidon.security.abac.policy.el.JavaxElPolicyExecutor.Builder
-
- All Implemented Interfaces:
Builder<JavaxElPolicyExecutor>
,Supplier<JavaxElPolicyExecutor>
- Enclosing class:
- JavaxElPolicyExecutor
public static final class JavaxElPolicyExecutor.Builder extends Object implements Builder<JavaxElPolicyExecutor>
A fluent API builder forJavaxElPolicyExecutor
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JavaxElPolicyExecutor.Builder
addMethod(String localName, Method method)
Add a custom method to be available in expressions without a prefix.JavaxElPolicyExecutor.Builder
addMethod(String prefix, String localName, Method method)
Add a custom method to be available in expressions.JavaxElPolicyExecutor
build()
Build the instance from this builder.JavaxElPolicyExecutor.Builder
config(Config config)
Updated builder from configuration.JavaxElPolicyExecutor.Builder
expressionFactory(javax.el.ExpressionFactory factory)
Configure a specific expression factory to use with this executor.
-
-
-
Method Detail
-
build
public JavaxElPolicyExecutor build()
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<JavaxElPolicyExecutor>
- Returns:
- instance of the built type
-
expressionFactory
public JavaxElPolicyExecutor.Builder expressionFactory(javax.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 expressionmethod
- method to invoke (may have parameters - these can be passed from the script)- Returns:
- updated builder instance
- See Also:
addMethod(String, String, Method)
-
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 expressionlocalName
- name to call this function in an expressionmethod
- 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
-
-