Class DefaultExpressionResolver
- java.lang.Object
-
- com.hybris.cockpitng.core.expression.impl.DefaultExpressionResolver
-
- All Implemented Interfaces:
ExpressionResolver
public class DefaultExpressionResolver extends java.lang.Object implements ExpressionResolver
Default implementation ofExpressionResolver
-
-
Constructor Summary
Constructors Constructor Description DefaultExpressionResolver(EvaluationContextFactory contextFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.springframework.expression.ExpressionParsercreateExpressionParser()protected EvaluationContextFactorygetContextFactory()protected org.springframework.expression.ExpressionParsergetExpressionParser()<T> TgetValue(java.lang.Object sourceObject, java.lang.String expression)Evaluates provided expression in regards to specified object.<T> TgetValue(java.lang.Object sourceObject, java.lang.String expression, java.util.Map<java.lang.String,java.lang.Object> variables)Evaluates provided expression in regards to specified object.<T> java.lang.Class<T>getValueType(java.lang.Object sourceObject, java.lang.String expression)Evaluates value type provided expression in regards to specified object.<T> java.lang.Class<T>getValueType(java.lang.Object sourceObject, java.lang.String expression, java.util.Map<java.lang.String,java.lang.Object> variables)Evaluates value type provided expression in regards to specified object.voidsetExpressionParser(org.springframework.expression.ExpressionParser expressionParser)voidsetValue(java.lang.Object sourceObject, java.lang.String expression, java.lang.Object value)Sets the value for the specified expression.voidsetValue(java.lang.Object sourceObject, java.lang.String expression, java.lang.Object value, java.util.Locale locale)Sets the value for the specified expression and locale.
-
-
-
Constructor Detail
-
DefaultExpressionResolver
public DefaultExpressionResolver(EvaluationContextFactory contextFactory)
-
-
Method Detail
-
getContextFactory
protected EvaluationContextFactory getContextFactory()
-
getExpressionParser
protected org.springframework.expression.ExpressionParser getExpressionParser()
-
setExpressionParser
public void setExpressionParser(org.springframework.expression.ExpressionParser expressionParser)
-
createExpressionParser
protected org.springframework.expression.ExpressionParser createExpressionParser()
-
getValue
public <T> T getValue(java.lang.Object sourceObject, java.lang.String expression)Description copied from interface:ExpressionResolverEvaluates provided expression in regards to specified object. CurrentLocaleis used during evaluation.- Specified by:
getValuein interfaceExpressionResolver- Returns:
- value of evaluation
-
getValue
public <T> T getValue(java.lang.Object sourceObject, java.lang.String expression, java.util.Map<java.lang.String,java.lang.Object> variables)Description copied from interface:ExpressionResolverEvaluates provided expression in regards to specified object. The returning map holds a locale as key and the value of this map holds the corresponding localized value of the expression.- Specified by:
getValuein interfaceExpressionResolver- Parameters:
sourceObject- object on which evaluation is performedexpression- given expressionvariables- variables passed toEvaluationContext.setVariable(String, Object)- Returns:
- value of evaluation
-
setValue
public void setValue(java.lang.Object sourceObject, java.lang.String expression, java.lang.Object value)Description copied from interface:ExpressionResolverSets the value for the specified expression.- Specified by:
setValuein interfaceExpressionResolver
-
setValue
public void setValue(java.lang.Object sourceObject, java.lang.String expression, java.lang.Object value, java.util.Locale locale)Description copied from interface:ExpressionResolverSets the value for the specified expression and locale. Assumes the the object has a setter with aLocaleas second argument for the given property.- Specified by:
setValuein interfaceExpressionResolver
-
getValueType
public <T> java.lang.Class<T> getValueType(java.lang.Object sourceObject, java.lang.String expression, java.util.Map<java.lang.String,java.lang.Object> variables)Description copied from interface:ExpressionResolverEvaluates value type provided expression in regards to specified object.- Specified by:
getValueTypein interfaceExpressionResolver- Parameters:
sourceObject- object on which evaluation is performedexpression- given expressionvariables- variables passed toEvaluationContext.setVariable(String, Object)- Returns:
- value type of evaluation
-
getValueType
public <T> java.lang.Class<T> getValueType(java.lang.Object sourceObject, java.lang.String expression)Description copied from interface:ExpressionResolverEvaluates value type provided expression in regards to specified object.- Specified by:
getValueTypein interfaceExpressionResolver- Parameters:
sourceObject- object on which evaluation is performedexpression- given expression- Returns:
- value type of evaluation
-
-