org.milyn.rules
Class RuleProviderAccessor

java.lang.Object
  extended by org.milyn.rules.RuleProviderAccessor

public final class RuleProviderAccessor
extends Object

RuleProviderAccessor provides convenience methods for adding and getting rule providers in a Smooks Application context.

Author:
Daniel Bevenius

Method Summary
static void add(org.milyn.container.ApplicationContext context, RuleProvider provider)
          Adds the passed-in provider to the Smooks ApplicationContext.
static RuleProvider get(org.milyn.container.ApplicationContext context, String ruleProviderName)
          Gets a RuleProvider matching the passed in ruleProviderName.
static Map<String,RuleProvider> getRuleProviders(org.milyn.container.ApplicationContext context)
          Gets the Map of RuleProviders that exist in the Smooks AppcliationContext.
static String parseRuleName(String compositeRuleName)
          Parse the rule name from the passed in composite rule name.
static String parseRuleProviderName(String compositeRuleName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

add

public static final void add(org.milyn.container.ApplicationContext context,
                             RuleProvider provider)
Adds the passed-in provider to the Smooks ApplicationContext.

Parameters:
context - The Smooks ApplicationContext.
provider - The RuleProvider that is to be added.

get

public static final RuleProvider get(org.milyn.container.ApplicationContext context,
                                     String ruleProviderName)
Gets a RuleProvider matching the passed in ruleProviderName.

Parameters:
context - The Smooks ApplicationContext.
ruleProviderName - The name of the rule provider to lookup.
Returns:
RuleProvider The RuleProvider matching the passed in ruleProviderName.
Throws:
org.milyn.SmooksException - If no providers have been previously set in the ApplicationContext, or if the specified ruleProviderName cannot be found.

getRuleProviders

public static Map<String,RuleProvider> getRuleProviders(org.milyn.container.ApplicationContext context)
Gets the Map of RuleProviders that exist in the Smooks AppcliationContext.

Parameters:
context - The Smooks ApplicationContext.
Returns:
Map The Map of rule providers. The String key is the name of the rule provider.

parseRuleName

public static String parseRuleName(String compositeRuleName)
Parse the rule name from the passed in composite rule name.

Parameters:
compositeRuleName - The composite rule name in the form ruleProvider.ruleName.
Returns:
String The rule name part of the composite rule name.

parseRuleProviderName

public static String parseRuleProviderName(String compositeRuleName)
Parameters:
compositeRuleName - The composite rule name in the form ruleProvider.ruleName.
Returns:
String The rule provider name part of the composite rule name.


Copyright © 2018. All rights reserved.