|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ofbiz.base.util.string.UelUtil
public class UelUtil
Implements the Unified Expression Language (JSR-245).
Nested Class Summary | |
---|---|
protected static class |
UelUtil.BasicContext
|
protected static class |
UelUtil.BasicValueExpression
|
protected static class |
UelUtil.BasicVariableMapper
|
protected static class |
UelUtil.ExtendedCompositeResolver
Custom CompositeELResolver used to handle variable
auto-vivify. |
protected static class |
UelUtil.ExtendedListResolver
Custom ListELResolver used to handle OFBiz
List syntax. |
protected static class |
UelUtil.ExtendedMapResolver
Custom MapELResolver class used to accommodate
LocalizedMap instances. |
Field Summary | |
---|---|
protected static ELResolver |
defaultResolver
|
protected static ExpressionFactory |
exprFactory
|
static java.lang.String |
localizedMapLocaleKey
|
protected static java.lang.String |
module
|
Constructor Summary | |
---|---|
UelUtil()
|
Method Summary | |
---|---|
static java.lang.Object |
autoVivifyListOrMap(java.lang.Object property)
Evaluates a property Object and returns a new
List or Map . |
static java.lang.Object |
evaluate(java.util.Map<java.lang.String,? extends java.lang.Object> context,
java.lang.String expression)
Evaluates a Unified Expression Language expression and returns the result. |
static java.lang.Object |
evaluate(java.util.Map<java.lang.String,? extends java.lang.Object> context,
java.lang.String expression,
java.lang.Class expectedType)
Evaluates a Unified Expression Language expression and returns the result. |
static java.lang.String |
prepareExpression(java.lang.String expression)
Prepares an expression for evaluation by UEL. |
static void |
removeValue(java.util.Map<java.lang.String,java.lang.Object> context,
java.lang.String expression)
Evaluates a Unified Expression Language expression and sets the resulting object to null. |
static java.lang.Object |
resolveVariable(java.lang.String variable,
java.util.Map<java.lang.String,java.lang.Object> variables,
java.util.Locale locale)
|
static void |
setValue(java.util.Map<java.lang.String,java.lang.Object> context,
java.lang.String expression,
java.lang.Class expectedType,
java.lang.Object value)
Evaluates a Unified Expression Language expression and sets the resulting object to the specified value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String module
public static final java.lang.String localizedMapLocaleKey
protected static final ExpressionFactory exprFactory
protected static final ELResolver defaultResolver
Constructor Detail |
---|
public UelUtil()
Method Detail |
---|
public static java.lang.Object evaluate(java.util.Map<java.lang.String,? extends java.lang.Object> context, java.lang.String expression)
context
- Evaluation context (variables)expression
- UEL expression
javax.el.*
- exceptionspublic static java.lang.Object evaluate(java.util.Map<java.lang.String,? extends java.lang.Object> context, java.lang.String expression, java.lang.Class expectedType)
context
- Evaluation context (variables)expression
- UEL expressionexpectedType
- The expected object Class to return
javax.el.*
- exceptionspublic static void setValue(java.util.Map<java.lang.String,java.lang.Object> context, java.lang.String expression, java.lang.Class expectedType, java.lang.Object value)
context
- Evaluation context (variables)expression
- UEL expressionexpectedType
- The expected object Class to set
javax.el.*
- exceptionspublic static void removeValue(java.util.Map<java.lang.String,java.lang.Object> context, java.lang.String expression)
context
- Evaluation context (variables)expression
- UEL expression
javax.el.*
- exceptionspublic static java.lang.Object autoVivifyListOrMap(java.lang.Object property)
Object
and returns a new
List
or Map
. If property
is not a String object type and it evaluates to an integer value,
a new List
instance is returned, otherwise a new
Map
instance is returned.
property
- Property Object
to be evaluated
List
or Map
public static java.lang.String prepareExpression(java.lang.String expression)
expression
- Expression to be converted
public static java.lang.Object resolveVariable(java.lang.String variable, java.util.Map<java.lang.String,java.lang.Object> variables, java.util.Locale locale)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |