public class RuleBuilder extends Object implements ParameterizedRule, RelocatableRule, CompositeCondition, CompositeOperation
Rule
instances.Modifier and Type | Method and Description |
---|---|
void |
accept(Visitor<Condition> visitor)
This method will call the supplied visitor for all conditions attached to the rule builder.
|
static RuleBuilder |
define()
Returns a new
RuleBuilder instance. |
static RuleBuilder |
define(String id)
Returns a new
RuleBuilder instance, set with the given Rule ID. |
boolean |
evaluate(Rewrite event,
EvaluationContext context)
Evaluate this condition against the given
Rewrite event. |
DefaultConditionBuilder |
getConditionBuilder()
Return the underlying
ConditionBuilder |
List<Condition> |
getConditions()
Returns all
Condition objects contained within this CompositeCondition ; otherwise, returns an
empty List . |
String |
getId()
Get the ID for this
Rule |
DefaultOperationBuilder |
getOperationBuilder()
Return the underlying
OperationBuilder |
List<Operation> |
getOperations()
Returns all
Operation objects contained within this CompositeOperation ; otherwise, returns an
empty List . |
ParameterStore |
getParameterStore()
Return the
ParameterStore for this Rule |
boolean |
isRelocated()
Returns true if this object should be relocated, or has been relocated.
|
RuleBuilder |
perform(Operation operation)
|
void |
perform(Rewrite event,
EvaluationContext context)
Perform the
Operation . |
int |
priority() |
String |
toString() |
RuleBuilder |
when(Condition condition)
|
ConfigurableParameter<?> |
where(String name) |
RuleBuilder |
withId(String id)
Set the ID of this
Rule instance. |
RuleBuilder |
withPriority(int priority)
Set the priority of this
Rule instance. |
static RuleBuilder |
wrap(Rule rule)
Returns a new
RuleBuilder instance wrapping the given Rule . |
public static RuleBuilder define()
RuleBuilder
instance.public static RuleBuilder wrap(Rule rule)
RuleBuilder
instance wrapping the given Rule
.public static RuleBuilder define(String id)
RuleBuilder
instance, set with the given Rule
ID.public RuleBuilder withId(String id)
Rule
instance.public RuleBuilder withPriority(int priority)
Rule
instance. If priority()
differs from the priority of the
ConfigurationProvider
from which this rule was returned, then relocate this rule to its new priority
position in the compiled rule set.public RuleBuilder when(Condition condition)
public RuleBuilder perform(Operation operation)
public boolean evaluate(Rewrite event, EvaluationContext context)
Condition
Rewrite
event. If this condition does
not apply to the given event, it must return false. If the condition applies and is satisfied, return true.public void perform(Rewrite event, EvaluationContext context)
Operation
Operation
.public int priority()
priority
in interface org.ocpsoft.common.pattern.Weighted
public boolean isRelocated()
Relocatable
isRelocated
in interface Relocatable
public DefaultConditionBuilder getConditionBuilder()
ConditionBuilder
public DefaultOperationBuilder getOperationBuilder()
OperationBuilder
public void accept(Visitor<Condition> visitor)
visitor
- visitor to processpublic List<Operation> getOperations()
CompositeOperation
Operation
objects contained within this CompositeOperation
; otherwise, returns an
empty List
.getOperations
in interface CompositeOperation
public List<Condition> getConditions()
CompositeCondition
Condition
objects contained within this CompositeCondition
; otherwise, returns an
empty List
.getConditions
in interface CompositeCondition
public ParameterStore getParameterStore()
ParameterizedRule
ParameterStore
for this Rule
getParameterStore
in interface ParameterizedRule
public ConfigurableParameter<?> where(String name)
Copyright © 2014 OCPsoft. All Rights Reserved.