Class SingleRuleProvider
- java.lang.Object
-
- org.ocpsoft.rewrite.context.ContextBase
-
- org.jboss.windup.config.AbstractRuleProvider
-
- org.jboss.windup.config.ruleprovider.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
ARuleProviderthat provides only a singleRule(itself).- Author:
- Lincoln Baxter, III
-
-
Constructor Summary
Constructors Constructor Description SingleRuleProvider()SingleRuleProvider(Class<? extends RuleProvider> implementationType, String id)SingleRuleProvider(RuleProviderMetadata metadata)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanevaluate(GraphRewrite event, org.ocpsoft.rewrite.context.EvaluationContext context)Evaluate thisRuleagainst the givenGraphRewriteevent.booleanevaluate(org.ocpsoft.rewrite.event.Rewrite event, org.ocpsoft.rewrite.context.EvaluationContext context)org.ocpsoft.rewrite.config.ConfigurationgetConfiguration(RuleLoaderContext ruleLoaderContext)KEEP - The purpose of this override is to make sure that reflection (interface.getClass().getMethods()) keeps a method with the specific type.StringgetId()abstract voidperform(GraphRewrite event, org.ocpsoft.rewrite.context.EvaluationContext context)Perform theOperation.voidperform(org.ocpsoft.rewrite.event.Rewrite event, org.ocpsoft.rewrite.context.EvaluationContext context)-
Methods inherited from class org.jboss.windup.config.AbstractRuleProvider
enhanceRuleMetadata, equals, getExecutionIndex, getMetadata, handles, hashCode, priority, setExecutionIndex, toString
-
-
-
-
Constructor Detail
-
SingleRuleProvider
public SingleRuleProvider()
-
SingleRuleProvider
public SingleRuleProvider(RuleProviderMetadata metadata)
-
SingleRuleProvider
public SingleRuleProvider(Class<? extends RuleProvider> implementationType, String id)
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getIdin interfaceorg.ocpsoft.rewrite.config.Rule
-
getConfiguration
public final org.ocpsoft.rewrite.config.Configuration getConfiguration(RuleLoaderContext ruleLoaderContext)
Description copied from interface:RuleProviderKEEP - 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:
getConfigurationin interfaceorg.ocpsoft.rewrite.config.ConfigurationProvider<RuleLoaderContext>- Specified by:
getConfigurationin interfaceRuleProvider
-
evaluate
public boolean evaluate(GraphRewrite event, org.ocpsoft.rewrite.context.EvaluationContext context)
Evaluate thisRuleagainst the givenGraphRewriteevent. If thisConditiondoes not apply to the given event, it must returnfalse. If the condition applies and is satisfied, returntrue. (Defaulttrue.)
-
perform
public abstract void perform(GraphRewrite event, org.ocpsoft.rewrite.context.EvaluationContext context)
Perform theOperation.
-
evaluate
public final boolean evaluate(org.ocpsoft.rewrite.event.Rewrite event, org.ocpsoft.rewrite.context.EvaluationContext context)- Specified by:
evaluatein interfaceorg.ocpsoft.rewrite.config.Condition
-
perform
public final void perform(org.ocpsoft.rewrite.event.Rewrite event, org.ocpsoft.rewrite.context.EvaluationContext context)- Specified by:
performin interfaceorg.ocpsoft.rewrite.config.Operation
-
-