Class SingleRuleProvider

  • All Implemented Interfaces:
    RuleProvider, org.ocpsoft.common.pattern.Specialized<Object>, org.ocpsoft.common.pattern.Weighted, org.ocpsoft.rewrite.config.Condition, org.ocpsoft.rewrite.config.ConfigurationProvider<RuleLoaderContext>, org.ocpsoft.rewrite.config.Operation, org.ocpsoft.rewrite.config.Rule, org.ocpsoft.rewrite.context.Context

    public abstract class SingleRuleProvider
    extends AbstractRuleProvider
    implements org.ocpsoft.rewrite.config.Rule
    A RuleProvider that provides only a single Rule (itself).
    Author:
    Lincoln Baxter, III
    • Constructor Detail

      • SingleRuleProvider

        public SingleRuleProvider()
    • Method Detail

      • getId

        public String getId()
        Specified by:
        getId in interface org.ocpsoft.rewrite.config.Rule
      • getConfiguration

        public final org.ocpsoft.rewrite.config.Configuration getConfiguration​(RuleLoaderContext ruleLoaderContext)
        Description copied from interface: RuleProvider
        KEEP - The purpose of this override is to make sure that reflection (interface.getClass().getMethods()) keeps a method with the specific type. Otherwise, type erasure will get rid of it and callers will get ClassCastExceptions in some obscure cases.
        Specified by:
        getConfiguration in interface org.ocpsoft.rewrite.config.ConfigurationProvider<RuleLoaderContext>
        Specified by:
        getConfiguration in interface RuleProvider
      • evaluate

        public boolean evaluate​(GraphRewrite event,
                                org.ocpsoft.rewrite.context.EvaluationContext context)
        Evaluate this Rule against the given GraphRewrite event. If this Condition does not apply to the given event, it must return false. If the condition applies and is satisfied, return true. (Default true.)
      • perform

        public abstract void perform​(GraphRewrite event,
                                     org.ocpsoft.rewrite.context.EvaluationContext context)
        Perform the Operation.
      • evaluate

        public final boolean evaluate​(org.ocpsoft.rewrite.event.Rewrite event,
                                      org.ocpsoft.rewrite.context.EvaluationContext context)
        Specified by:
        evaluate in interface org.ocpsoft.rewrite.config.Condition
      • perform

        public final void perform​(org.ocpsoft.rewrite.event.Rewrite event,
                                  org.ocpsoft.rewrite.context.EvaluationContext context)
        Specified by:
        perform in interface org.ocpsoft.rewrite.config.Operation