Class SpelRule

java.lang.Object
com.helixframework.rules.rule.BaseRule
com.helixframework.rules.rule.spel.SpelRule
All Implemented Interfaces:
Rule

public class SpelRule extends BaseRule
Rule that invokes a Spring Expression Language expression.
  • Method Details

    • builder

      public static SpelRule.Builder builder(String name, String expression)
      Builder for creating new instances of SpelRule.
      Parameters:
      name - rule name
      expression - spel expression
      Returns:
      a SpelRule.Builder
    • applyInternal

      protected void applyInternal(RuleContext<?> ctx)
      Description copied from class: BaseRule
      Applies the logic of the implementing rule and modifies the root object in the context.
      Specified by:
      applyInternal in class BaseRule
      Parameters:
      ctx - rule context
    • applyInternal

      protected <T> T applyInternal(RuleContext<?> ctx, Class<T> outputType)
      Description copied from class: BaseRule
      Applies the logic of the implementing rule and returns the result.
      Specified by:
      applyInternal in class BaseRule
      Type Parameters:
      T - type of rule output
      Parameters:
      ctx - rule context
      outputType - type of rule output
      Returns:
      rule result
    • getType

      public RuleType getType()
      Description copied from interface: Rule
      Gets the type of rule.
      Returns:
      rule type
    • getExpression

      public org.springframework.expression.Expression getExpression()
      Gets the SPEL expression.
      Returns:
      spel expression
    • toString

      public String toString()
      Overrides:
      toString in class Object