Package org.ocpsoft.rewrite.config
Class ConfigurationRuleBuilder
java.lang.Object
org.ocpsoft.rewrite.config.ConfigurationBuilder
org.ocpsoft.rewrite.config.ConfigurationRuleBuilder
- All Implemented Interfaces:
Condition,Configuration,ConfigurationBuilderRoot,ConfigurationRuleBuilderCustom,ConfigurationRuleBuilderOtherwise,ConfigurationRuleBuilderPerform,ConfigurationRuleBuilderWhen,ConfigurationRuleBuilderWithId,ConfigurationRuleBuilderWithMetadata,ConfigurationRuleBuilderWithPriority,ConfigurationRuleBuilderWithPriorityAndId,Operation,Rule,Parameterized,ParameterizedRule
public class ConfigurationRuleBuilder
extends ConfigurationBuilder
implements ParameterizedRule, ConfigurationRuleBuilderCustom, ConfigurationRuleBuilderWhen, ConfigurationRuleBuilderPerform, ConfigurationRuleBuilderOtherwise, ConfigurationRuleBuilderWithId, ConfigurationRuleBuilderWithPriority, ConfigurationRuleBuilderWithPriorityAndId
An intermediate stage
Rule configuration.- Author:
- Lincoln Baxter, III
-
Method Summary
Modifier and TypeMethodDescriptionaddRule()Add a new fluentRule.Add aRule.booleanevaluate(Rewrite event, EvaluationContext context) Evaluate this condition against the givenRewriteevent.getId()Get the ID for thisRuleReturn theParameterStorefor thisRuleGet all requiredParameternames for thisParameterizedinstance.Provides access to theRuleBuilderfor the currentRule.getRules()Get the list ofRuleinstances defined by thisConfigurationvoidperform(Rewrite event, EvaluationContext context) Perform theOperation.voidsetParameterStore(ParameterStore store) Initialize thisParameterizedinstance with the globalParameterStore.Configure theParameterwith the given name.Set the ID for the currentRule.withMetadata(Object key, Object value) Specify additional meta-data to be associated with thisRule.withPriority(int priority) Set the priority of thisRuleinstance.Methods inherited from class org.ocpsoft.rewrite.config.ConfigurationBuilder
begin, toString
-
Method Details
-
addRule
Description copied from class:ConfigurationBuilderAdd aRule.- Specified by:
addRulein interfaceConfigurationBuilderRoot- Overrides:
addRulein classConfigurationBuilder
-
addRule
Description copied from class:ConfigurationBuilderAdd a new fluentRule.- Specified by:
addRulein interfaceConfigurationBuilderRoot- Overrides:
addRulein classConfigurationBuilder
-
where
Description copied from interface:ConfigurationRuleBuilderPerformConfigure theParameterwith the given name.- Specified by:
wherein interfaceConfigurationRuleBuilderOtherwise- Specified by:
wherein interfaceConfigurationRuleBuilderPerform
-
when
Description copied from interface:ConfigurationRuleBuilderCustom- Specified by:
whenin interfaceConfigurationRuleBuilderCustom
-
when
Description copied from interface:ConfigurationRuleBuilderCustomSet theConditions of thisRuleinstance. This creates an implicitAndbetween all providedConditioninstances.- Specified by:
whenin interfaceConfigurationRuleBuilderCustom
-
perform
Description copied from interface:ConfigurationRuleBuilderCustom- Specified by:
performin interfaceConfigurationRuleBuilderCustom- Specified by:
performin interfaceConfigurationRuleBuilderWhen
-
perform
Description copied from interface:ConfigurationRuleBuilderCustom- Specified by:
performin interfaceConfigurationRuleBuilderCustom- Specified by:
performin interfaceConfigurationRuleBuilderWhen
-
otherwise
Description copied from interface:ConfigurationRuleBuilderWhen- Specified by:
otherwisein interfaceConfigurationRuleBuilderPerform- Specified by:
otherwisein interfaceConfigurationRuleBuilderWhen
-
otherwise
Description copied from interface:ConfigurationRuleBuilderWhen- Specified by:
otherwisein interfaceConfigurationRuleBuilderPerform- Specified by:
otherwisein interfaceConfigurationRuleBuilderWhen
-
withPriority
Description copied from interface:ConfigurationRuleBuilderPerformSet the priority of thisRuleinstance. If#priority()differs from the priority of theConfigurationProviderfrom which this rule was returned, then relocate this rule to its new priority position in the compiled rule set.- Specified by:
withPriorityin interfaceConfigurationRuleBuilderOtherwise- Specified by:
withPriorityin interfaceConfigurationRuleBuilderPerform- Specified by:
withPriorityin interfaceConfigurationRuleBuilderWithId
-
withId
Description copied from interface:ConfigurationRuleBuilderPerformSet the ID for the currentRule. This may be used in logging and for rule lookup purposes.- Specified by:
withIdin interfaceConfigurationRuleBuilderOtherwise- Specified by:
withIdin interfaceConfigurationRuleBuilderPerform- Specified by:
withIdin interfaceConfigurationRuleBuilderWithPriority
-
getRuleBuilder
Provides access to theRuleBuilderfor the currentRule. -
getRules
Description copied from interface:ConfigurationGet the list ofRuleinstances defined by thisConfiguration- Specified by:
getRulesin interfaceConfiguration- Overrides:
getRulesin classConfigurationBuilder
-
getRuleBuilders
- Overrides:
getRuleBuildersin classConfigurationBuilder
-
getParameterStore
Description copied from interface:ParameterizedRuleReturn theParameterStorefor thisRule- Specified by:
getParameterStorein interfaceParameterizedRule
-
getId
Description copied from interface:RuleGet the ID for thisRule -
evaluate
Description copied from interface:ConditionEvaluate this condition against the givenRewriteevent. If this condition does not apply to the given event, it must return false. If the condition applies and is satisfied, return true. -
perform
Description copied from interface:OperationPerform theOperation. -
getRequiredParameterNames
Description copied from interface:ParameterizedGet all requiredParameternames for thisParameterizedinstance.- Specified by:
getRequiredParameterNamesin interfaceParameterized
-
setParameterStore
Description copied from interface:ParameterizedInitialize thisParameterizedinstance with the globalParameterStore.- Specified by:
setParameterStorein interfaceParameterized
-
withMetadata
Description copied from interface:ConfigurationRuleBuilderWithMetadataSpecify additional meta-data to be associated with thisRule. Meta-data does not directly affect aRule's behavior, but can be used to provide hints to custom extensions.- Specified by:
withMetadatain interfaceConfigurationRuleBuilderWithMetadata
-