Class SpelRule
java.lang.Object
com.helixframework.rules.rule.BaseRule
com.helixframework.rules.rule.spel.SpelRule
- All Implemented Interfaces:
Rule
Rule that invokes a Spring Expression Language expression.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface com.helixframework.rules.rule.Rule
DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyInternal(RuleContext<?> ctx) Applies the logic of the implementing rule and modifies the root object in the context.protected <T> TapplyInternal(RuleContext<?> ctx, Class<T> outputType) Applies the logic of the implementing rule and returns the result.static SpelRule.BuilderBuilder for creating new instances ofSpelRule.org.springframework.expression.ExpressionGets the SPEL expression.getType()Gets the type of rule.toString()Methods inherited from class com.helixframework.rules.rule.BaseRule
apply, apply, apply, apply, getClassification, getDependencies, getDescription, getMaxRetries, getName, getTags, getTimeout
-
Method Details
-
builder
Builder for creating new instances ofSpelRule.- Parameters:
name- rule nameexpression- spel expression- Returns:
- a
SpelRule.Builder
-
applyInternal
Description copied from class:BaseRuleApplies the logic of the implementing rule and modifies the root object in the context.- Specified by:
applyInternalin classBaseRule- Parameters:
ctx- rule context
-
applyInternal
Description copied from class:BaseRuleApplies the logic of the implementing rule and returns the result.- Specified by:
applyInternalin classBaseRule- Type Parameters:
T- type of rule output- Parameters:
ctx- rule contextoutputType- type of rule output- Returns:
- rule result
-
getType
Description copied from interface:RuleGets the type of rule.- Returns:
- rule type
-
getExpression
public org.springframework.expression.Expression getExpression()Gets the SPEL expression.- Returns:
- spel expression
-
toString
-