Package org.springframework.binding.expression.support

Examples of org.springframework.binding.expression.support.FluentParserContext


    return getLocalContext().getFlowArtifactFactory().createTransition(stateResolver, null, null, null);
  }

  private Expression parseSubflowExpression(String subflow) {
    Expression subflowId = getLocalContext().getExpressionParser().parseExpression(subflow,
        new FluentParserContext().template().evaluate(RequestContext.class).expectResult(String.class));
    return new SubflowExpression(subflowId, getLocalContext().getFlowDefinitionLocator());
  }
View Full Code Here


  }

  private Action parseEvaluateAction(EvaluateModel evaluate) {
    String expressionString = evaluate.getExpression();
    Expression expression = getLocalContext().getExpressionParser().parseExpression(expressionString,
        new FluentParserContext().evaluate(RequestContext.class));
    return new EvaluateAction(expression, parseEvaluationActionResultExposer(evaluate));
  }
View Full Code Here

  }

  private ActionResultExposer parseEvaluationActionResultExposer(EvaluateModel evaluate) {
    if (StringUtils.hasText(evaluate.getResult())) {
      Expression resultExpression = getLocalContext().getExpressionParser().parseExpression(evaluate.getResult(),
          new FluentParserContext().evaluate(RequestContext.class));
      Class expectedResultType = null;
      if (StringUtils.hasText(evaluate.getResultType())) {
        expectedResultType = toClass(evaluate.getResultType());
      }
      return new ActionResultExposer(resultExpression, expectedResultType, getLocalContext()
View Full Code Here

  }

  private Action parseRenderAction(RenderModel render) {
    String[] fragmentExpressionStrings = StringUtils.commaDelimitedListToStringArray(render.getFragments());
    fragmentExpressionStrings = StringUtils.trimArrayElements(fragmentExpressionStrings);
    ParserContext context = new FluentParserContext().template().evaluate(RequestContext.class).expectResult(
        String.class);
    Expression[] fragments = new Expression[fragmentExpressionStrings.length];
    for (int i = 0; i < fragmentExpressionStrings.length; i++) {
      String fragment = fragmentExpressionStrings[i];
      fragments[i] = getLocalContext().getExpressionParser().parseExpression(fragment, context);
View Full Code Here

    return new RenderAction(fragments);
  }

  private Action parseSetAction(SetModel set) {
    Expression nameExpression = getLocalContext().getExpressionParser().parseExpression(set.getName(),
        new FluentParserContext().evaluate(RequestContext.class));
    Expression valueExpression = getLocalContext().getExpressionParser().parseExpression(set.getValue(),
        new FluentParserContext().evaluate(RequestContext.class));
    Class expectedType = null;
    if (StringUtils.hasText(set.getType())) {
      expectedType = toClass(set.getType());
    }
    return new SetAction(nameExpression, valueExpression, expectedType, getLocalContext().getConversionService());
View Full Code Here

    return everMapping;
  }
 
  private void addMapping(DefaultMapper mapper, String expressionString) {
    Expression expression = expressionParser.parseExpression(expressionString,
        new FluentParserContext().evaluate(RequestContext.class));
    DefaultMapping mapping = new DefaultMapping(expression, expression);
    mapping.setRequired(false);
    if (logger.isDebugEnabled()) {
      logger.debug("Adding mapping for expression '" + expressionString + "'");
    }
View Full Code Here

    }
  }

  private void addMapping(DefaultMapper mapper, Binding binding, Object model) {
    Expression source = new RequestParameterExpression(binding.getProperty());
    ParserContext parserContext = new FluentParserContext().evaluate(model.getClass());
    Expression target = expressionParser.parseExpression(binding.getProperty(), parserContext);
    DefaultMapping mapping = new DefaultMapping(source, target);
    mapping.setRequired(binding.getRequired());
    if (binding.getConverter() != null) {
      ConversionExecutor conversionExecutor = conversionService.getConversionExecutor(binding.getConverter(),
View Full Code Here

      }
    }
  }

  private void addEmptyValueMapping(DefaultMapper mapper, String field, Object model) {
    ParserContext parserContext = new FluentParserContext().evaluate(model.getClass());
    Expression target = expressionParser.parseExpression(field, parserContext);
    try {
      Class propertyType = target.getValueType(model);
      Expression source = new StaticExpression(getEmptyValue(propertyType));
      DefaultMapping mapping = new DefaultMapping(source, target);
View Full Code Here

    }
  }

  private void addDefaultMapping(DefaultMapper mapper, String parameter, Object model) {
    Expression source = new RequestParameterExpression(parameter);
    ParserContext parserContext = new FluentParserContext().evaluate(model.getClass());
    Expression target = expressionParser.parseExpression(parameter, parserContext);
    DefaultMapping mapping = new DefaultMapping(source, target);
    if (logger.isDebugEnabled()) {
      logger.debug("Adding default mapping for parameter '" + parameter + "'");
    }
View Full Code Here

    trackingListener = new TrackingPhaseListener();
    jsfMock.lifecycle().addPhaseListener(trackingListener);
    jsfMock.facesContext().setViewRoot(null);
    jsfMock.facesContext().getApplication().setViewHandler(viewHandler);
    lifecycle = new TestLifecycle(jsfMock.lifecycle());
    factory = new JsfViewFactory(parser.parseExpression("#{'" + VIEW_ID + "'}", new FluentParserContext()
        .template().evaluate(RequestContext.class).expectResult(String.class)), lifecycle);
    RequestContextHolder.setRequestContext(context);
    MockExternalContext ext = new MockExternalContext();
    ext.setNativeContext(new MockServletContext());
    ext.setNativeRequest(new MockHttpServletRequest());
View Full Code Here

TOP

Related Classes of org.springframework.binding.expression.support.FluentParserContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.