Examples of BinderConfiguration


Examples of org.springframework.webflow.engine.builder.BinderConfiguration

    context.getMockExternalContext().setNativeResponse(new MockHttpServletResponse());
    context.getMockFlowExecutionContext().setKey(new MockFlowExecutionKey("c1v1"));
    org.springframework.web.servlet.View mvcView = new MockView();
    AbstractMvcView view = new MockMvcView(mvcView, context);
    view.setExpressionParser(DefaultExpressionParserFactory.getExpressionParser());
    BinderConfiguration binderConfiguration = new BinderConfiguration();
    binderConfiguration.addBinding(new Binding("stringProperty", null, true));
    view.setBinderConfiguration(binderConfiguration);
    view.processUserEvent();
    assertTrue(view.hasFlowEvent());
    assertEquals("submit", view.getFlowEvent().getId());
    assertEquals("foo", bindBean.getStringProperty());
View Full Code Here

Examples of org.springframework.webflow.engine.builder.BinderConfiguration

      return createViewFactory(viewId, binderModel);
    }
  }

  private ViewFactory createViewFactory(Expression viewId, BinderModel binderModel) {
    BinderConfiguration binderConfiguration = createBinderConfiguration(binderModel);
    return getLocalContext().getViewFactoryCreator().createViewFactory(viewId,
        getLocalContext().getExpressionParser(), getLocalContext().getConversionService(), binderConfiguration);
  }
View Full Code Here

Examples of org.springframework.webflow.engine.builder.BinderConfiguration

        getLocalContext().getExpressionParser(), getLocalContext().getConversionService(), binderConfiguration);
  }

  private BinderConfiguration createBinderConfiguration(BinderModel binderModel) {
    if (binderModel != null && binderModel.getBindings() != null) {
      BinderConfiguration binderConfiguration = new BinderConfiguration();
      List bindings = binderModel.getBindings();
      for (Iterator it = bindings.iterator(); it.hasNext();) {
        BindingModel bindingModel = (BindingModel) it.next();
        boolean required;
        if (StringUtils.hasText(bindingModel.getRequired())) {
          required = ((Boolean) fromStringTo(Boolean.class).execute(bindingModel.getRequired()))
              .booleanValue();
        } else {
          required = false;
        }
        Binding binding = new Binding(bindingModel.getProperty(), bindingModel.getConverter(), required);
        binderConfiguration.addBinding(binding);
      }
      return binderConfiguration;
    } else {
      return null;
    }
View Full Code Here

Examples of org.springframework.webflow.engine.builder.BinderConfiguration

    context.getMockExternalContext().setNativeResponse(new MockHttpServletResponse());
    context.getMockFlowExecutionContext().setKey(new MockFlowExecutionKey("c1v1"));
    org.springframework.web.servlet.View mvcView = new MockView();
    AbstractMvcView view = new MockMvcView(mvcView, context);
    view.setExpressionParser(createExpressionParser());
    BinderConfiguration binderConfiguration = new BinderConfiguration();
    binderConfiguration.addBinding(new Binding("stringProperty", null, true));
    view.setBinderConfiguration(binderConfiguration);
    view.processUserEvent();
    assertTrue(view.hasFlowEvent());
    assertEquals("submit", view.getFlowEvent().getId());
    assertEquals("foo", bindBean.getStringProperty());
View Full Code Here

Examples of org.springframework.webflow.engine.builder.BinderConfiguration

    DefaultConversionService conversionService = new DefaultConversionService();
    StringToDate stringToDate = new StringToDate();
    stringToDate.setPattern("MM-dd-yyyy");
    conversionService.addConverter("customDateConverter", stringToDate);
    view.setConversionService(conversionService);
    BinderConfiguration binderConfiguration = new BinderConfiguration();
    binderConfiguration.addBinding(new Binding("dateProperty", "customDateConverter", true));
    view.setBinderConfiguration(binderConfiguration);
    view.processUserEvent();
    assertTrue(view.hasFlowEvent());
    assertEquals("submit", view.getFlowEvent().getId());
    Calendar cal = Calendar.getInstance();
View Full Code Here

Examples of org.springframework.webflow.engine.builder.BinderConfiguration

      protected String toString(Object object) throws Exception {
        return "$" + object;
      }
    });
    BinderConfiguration binder = new BinderConfiguration();
    binder.addBinding(new Binding("datum2", "customConverter", true));
    model.setBinderConfiguration(binder);
    assertEquals("$3", model.getFieldValue("datum2"));
  }
View Full Code Here

Examples of org.springframework.webflow.engine.builder.BinderConfiguration

      return createViewFactory(viewId, binderModel);
    }
  }

  private ViewFactory createViewFactory(Expression viewId, BinderModel binderModel) {
    BinderConfiguration binderConfiguration = createBinderConfiguration(binderModel);
    return getLocalContext().getViewFactoryCreator().createViewFactory(viewId,
        getLocalContext().getExpressionParser(), getLocalContext().getConversionService(), binderConfiguration,
        getLocalContext().getValidator(), getLocalContext().getValidationHintResolver());
  }
View Full Code Here

Examples of org.springframework.webflow.engine.builder.BinderConfiguration

        getLocalContext().getValidator(), getLocalContext().getValidationHintResolver());
  }

  private BinderConfiguration createBinderConfiguration(BinderModel binderModel) {
    if (binderModel != null && binderModel.getBindings() != null) {
      BinderConfiguration binderConfiguration = new BinderConfiguration();
      List<BindingModel> bindings = binderModel.getBindings();
      for (BindingModel bindingModel : bindings) {
        boolean required = false;
        if (StringUtils.hasText(bindingModel.getRequired())) {
          required = ((Boolean) fromStringTo(Boolean.class).execute(bindingModel.getRequired()));
        }
        Binding binding = new Binding(bindingModel.getProperty(), bindingModel.getConverter(), required);
        binderConfiguration.addBinding(binding);
      }
      return binderConfiguration;
    } else {
      return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.