|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.broadleafcommerce.common.rule.MvelHelper
public class MvelHelper
Helper class for some common rule functions that can be called from mvel as well as utility functions to make calling MVEL rules within Broadleaf easier. An instance of this class is available to the mvel runtime under the variable name MvelHelper with the following functions: convertField(type, fieldValue) toUpperCase(value)
| Constructor Summary | |
|---|---|
MvelHelper()
|
|
| Method Summary | |
|---|---|
static Object |
convertField(String type,
String fieldValue)
Converts a field to the specified type. |
static boolean |
evaluateRule(String rule,
Map<String,Object> ruleParameters)
Returns true if the passed in rule passes based on the passed in ruleParameters. |
static boolean |
evaluateRule(String rule,
Map<String,Object> ruleParameters,
Map expressionCache)
Evaluates the passed in rule given the passed in parameters. |
static Object |
toUpperCase(String value)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MvelHelper()
| Method Detail |
|---|
public static Object convertField(String type,
String fieldValue)
type - fieldValue -
public static Object toUpperCase(String value)
public static boolean evaluateRule(String rule,
Map<String,Object> ruleParameters)
evaluateRule(String, Map, Map) method passing in the DEFAULT_EXPRESSION_CACHE.
For systems that need to cache a large number of rule expressions, an alternate cache can be passed in. The
default cache is able to cache up to 1,000 rule expressions which should suffice for most systems.
rule - ruleParameters -
public static boolean evaluateRule(String rule,
Map<String,Object> ruleParameters,
Map expressionCache)
rule - ruleParameters -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||