org.broadleafcommerce.common.rule
Class AbstractRuleProcessor<T>

java.lang.Object
  extended by org.broadleafcommerce.common.rule.AbstractRuleProcessor<T>
All Implemented Interfaces:
RuleProcessor<T>

public abstract class AbstractRuleProcessor<T>
extends Object
implements RuleProcessor<T>


Field Summary
protected  Map<String,String> contextClassNames
           
protected  Map<String,Serializable> expressionCache
           
protected  org.apache.commons.logging.Log LOG
           
protected  org.mvel2.ParserContext parserContext
           
 
Constructor Summary
AbstractRuleProcessor()
           
 
Method Summary
protected  Boolean executeExpression(String expression, Map<String,Object> vars)
          Helpful method for processing a boolean MVEL expression and associated arguments.
 Map<String,String> getContextClassNames()
          List of class names to add to the MVEL ParserContext.
protected  org.mvel2.ParserContext getParserContext()
          Having a parser context that imports the classes speeds MVEL by up to 60%.
 void setContextClassNames(Map<String,String> contextClassNames)
          List of class names to add to the MVEL ParserContext.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.broadleafcommerce.common.rule.RuleProcessor
checkForMatch
 

Field Detail

LOG

protected final org.apache.commons.logging.Log LOG

expressionCache

protected Map<String,Serializable> expressionCache

parserContext

protected org.mvel2.ParserContext parserContext

contextClassNames

protected Map<String,String> contextClassNames
Constructor Detail

AbstractRuleProcessor

public AbstractRuleProcessor()
Method Detail

getParserContext

protected org.mvel2.ParserContext getParserContext()
Having a parser context that imports the classes speeds MVEL by up to 60%.


executeExpression

protected Boolean executeExpression(String expression,
                                    Map<String,Object> vars)
Helpful method for processing a boolean MVEL expression and associated arguments. Caches the expression in an LRUCache.

Parameters:
expression -
vars -
Returns:
the result of the expression

getContextClassNames

public Map<String,String> getContextClassNames()
List of class names to add to the MVEL ParserContext.

See Also:
ParserContext}

setContextClassNames

public void setContextClassNames(Map<String,String> contextClassNames)
List of class names to add to the MVEL ParserContext.

See Also:
ParserContext}


Copyright © 2013. All Rights Reserved.