Package org.springframework.format.support

Examples of org.springframework.format.support.DefaultFormattingConversionService


   * need to be formatted as Strings before being added to the URI
   */
  public CompositeUriComponentsContributor(Collection<?> contributors, ConversionService cs) {
    Assert.notNull(contributors, "'uriComponentsContributors' must not be null");
    this.contributors.addAll(contributors);
    this.conversionService = (cs != null ? cs : new DefaultFormattingConversionService());
  }
View Full Code Here


   * controller methods and the {@code spring:eval} JSP tag.
   * Also see {@link #addFormatters} as an alternative to overriding this method.
   */
  @Bean
  public FormattingConversionService mvcConversionService() {
    FormattingConversionService conversionService = new DefaultFormattingConversionService();
    addFormatters(conversionService);
    return conversionService;
  }
View Full Code Here

    assertEquals("id", dataBinder.getDisallowedFields()[0]);
  }

  @Test
  public void createBinderWithGlobalInitialization() throws Exception {
    ConversionService conversionService = new DefaultFormattingConversionService();
    bindingInitializer.setConversionService(conversionService);

    WebDataBinderFactory factory = createBinderFactory("initBinder", WebDataBinder.class);
    WebDataBinder dataBinder = factory.createBinder(webRequest, null, null);
View Full Code Here

  private FormattingConversionService conversionService;

  @Before
  public void setup() {
    this.conversionService = new DefaultFormattingConversionService();
    DataBinder dataBinder = new DataBinder(null);
    dataBinder.setConversionService(conversionService);

    this.redirectAttributes = new RedirectAttributesModelMap(dataBinder);
  }
View Full Code Here

    }

    if (configuration.getConversionService() == null) {
      Map<String, ConversionService> conversionServices = context.getBeansOfType(ConversionService.class);
      if (conversionServices.isEmpty()) {
        configuration.setConversionService(new DefaultFormattingConversionService());
      } else if (conversionServices.size() == 1) {
        configuration.setConversionService(conversionServices.values().iterator().next());
      } else {
        if (conversionServices.containsKey("mvcConversionService")) {
          configuration.setConversionService(conversionServices.get("mvcConversionService"));
View Full Code Here

    }

    if (configuration.getConversionService() == null) {
      Map<String, ConversionService> conversionServices = context.getBeansOfType(ConversionService.class);
      if (conversionServices.isEmpty()) {
        configuration.setConversionService(new DefaultFormattingConversionService());
      } else if (conversionServices.size() == 1) {
        configuration.setConversionService(conversionServices.values().iterator().next());
      } else {
        if (conversionServices.containsKey("mvcConversionService")) {
          configuration.setConversionService(conversionServices.get("mvcConversionService"));
View Full Code Here

    }

    if (configuration.getConversionService() == null) {
      Map<String, ConversionService> conversionServices = context.getBeansOfType(ConversionService.class);
      if (conversionServices.isEmpty()) {
        configuration.setConversionService(new DefaultFormattingConversionService());
      } else if (conversionServices.size() == 1) {
        configuration.setConversionService(conversionServices.values().iterator().next());
      } else {
        if (conversionServices.containsKey("mvcConversionService")) {
          configuration.setConversionService(conversionServices.get("mvcConversionService"));
View Full Code Here

    if (configuration.getConversionService() == null) {
      Map<String, ConversionService> conversionServices = context
          .getBeansOfType(ConversionService.class);
      if (conversionServices.isEmpty()) {
        configuration
            .setConversionService(new DefaultFormattingConversionService());
      }
      else if (conversionServices.size() == 1) {
        configuration.setConversionService(conversionServices.values().iterator()
            .next());
      }
View Full Code Here

  private MockMvc mockMvc;

  @Before
  public void setup() throws Exception {
    this.mockMvc = standaloneSetup(new RedirectController(new DefaultFormattingConversionService()))
        .alwaysExpect(status().isMovedTemporarily()).build();
  }
View Full Code Here

 
  private MockMvc mockMvc;

  @Before
  public void setup() throws Exception {
    FormattingConversionService cs = new DefaultFormattingConversionService();
    cs.addFormatterForFieldAnnotation(new MaskFormatAnnotationFormatterFactory());

    this.mockMvc = standaloneSetup(new ConvertController())
        .setConversionService(cs)
        .alwaysExpect(status().isOk())
        .build();
View Full Code Here

TOP

Related Classes of org.springframework.format.support.DefaultFormattingConversionService

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.