/** * Evaluate this method parameter against the provided argument source, returning a single method argument value. * @param argumentSource the meyhod argument source * @param context the evaluation context * @return the method argument value */ public Object evaluateArgument(Object argumentSource, EvaluationContext context) { return name.evaluate(argumentSource, context); }
public Object evaluate(Object target, EvaluationContext context) throws EvaluationException { return collectionExpression.evaluate(target, context); }
public Object evaluate(Object target, EvaluationContext context) throws EvaluationException { if (target instanceof RequestContext) { RequestContext requestContext = (RequestContext) target; AttributeMap scope = scopeType.getScope(requestContext); return expression.evaluate(scope, context); } else if (target instanceof AttributeMap) { return expression.evaluate(target, context); } else { throw new IllegalArgumentException( "Only supports evaluation against a [RequestContext] or [AttributeMap] instance, but was a [" + target.getClass() + "]"); } }
public Object evaluate(Object target, EvaluationContext evaluationContext) throws EvaluationException { StringBuffer buffer = new StringBuffer(128); for (int i = 0; i < expressions.length; i++) { buffer.append(expressions[i].evaluate(target, evaluationContext)); } return buffer.toString(); }
/** * Evaluates a model attribute expression. * @param attributeName the attribute expression * @param model the model map * @return the attribute expression value */ protected Object evaluateModelAttributeExpression(String attributeName, Map model) { return expressionParser.parseExpression(attributeName).evaluate(model, null); }
public boolean test(RequestContext context) { Object result = booleanExpression.evaluate(context, getEvaluationContext(context)); Assert.isInstanceOf(Boolean.class, result, "Impossible to determine result of boolean expression: "); return ((Boolean) result).booleanValue(); }
/** * Resolves the application view name from the request context. * @param context the context * @return the view name */ protected String resolveViewName(RequestContext context) { return (String) getViewName().evaluate(context, null); }
public ViewSelection makeEntrySelection(RequestContext context) { String url = (String) urlExpression.evaluate(context, null); return new ExternalRedirect(url); }
public State resolveTargetState(Transition transition, State sourceState, RequestContext context) { String stateId = String.valueOf(targetStateIdExpression.evaluate(context, null)); return ((Flow) context.getActiveFlow()).getStateInstance(stateId); }
public ViewSelection makeEntrySelection(RequestContext context) { String encodedRedirect = (String) expression.evaluate(context, null); if (encodedRedirect == null) { throw new IllegalStateException(
/** * Map the <code>sourceAttribute</code> in to the <code>targetAttribute</code> target map, performing type * conversion if necessary. * @param source The source data structure * @param target The target data structure */ public void map(Object source, Object target, MappingContext context) { // get source value Object sourceValue = sourceExpression.evaluate(source, null); if (sourceValue == null) { if (required) { throw new RequiredMappingException("This mapping is required; evaluation of expression '" + sourceExpression + "' against source of type [" + source.getClass() + "] must return a non-null value"); } else { // source expression returned no value, simply abort mapping return; } } Object targetValue = sourceValue; if (typeConverter != null) { targetValue = typeConverter.execute(sourceValue); } // set target value if (logger.isDebugEnabled()) { logger.debug("Mapping '" + sourceExpression + "' value [" + sourceValue + "] to target property '" + targetExpression + "'; setting property value to [" + targetValue + "]"); } targetExpression.evaluateToSet(target, targetValue, null); }
protected Event doExecute(RequestContext context) throws Exception { EvaluationContext evaluationContext = getEvaluationContext(context); Object value = valueExpression.evaluate(context, evaluationContext); MutableAttributeMap scopeMap = scope.getScope(context); attributeExpression.evaluateToSet(scopeMap, value, evaluationContext); return success(); }
protected Event doExecute(RequestContext context) throws Exception { Object result = expression.evaluate(context, getEvaluationContext(context)); if (evaluationResultExposer != null) { evaluationResultExposer.exposeResult(result, context); } return resultEventFactorySelector.forResult(result).createResultEvent(this, result, context); }