Class JavaxElPolicyExecutor.Builder

    • Method Detail

      • 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 expression
        method - 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 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