Examples of JodaDateTimeFormatAnnotationFormatterFactory


Examples of org.springframework.format.datetime.joda.JodaDateTimeFormatAnnotationFormatterFactory

    }
  }

  @Test
  public void testFormatFieldForAnnotation() throws Exception {
    formattingService.addFormatterForFieldAnnotation(new JodaDateTimeFormatAnnotationFormatterFactory());
    doTestFormatFieldForAnnotation(Model.class, false);
  }
View Full Code Here

Examples of org.springframework.format.datetime.joda.JodaDateTimeFormatAnnotationFormatterFactory

    doTestFormatFieldForAnnotation(Model.class, false);
  }

  @Test
  public void testFormatFieldForAnnotationWithDirectFieldAccess() throws Exception {
    formattingService.addFormatterForFieldAnnotation(new JodaDateTimeFormatAnnotationFormatterFactory());
    doTestFormatFieldForAnnotation(Model.class, true);
  }
View Full Code Here

Examples of org.springframework.format.datetime.joda.JodaDateTimeFormatAnnotationFormatterFactory

    props.setProperty("datePattern", "M-d-yy");
    ppc.setProperties(props);
    context.getBeanFactory().registerSingleton("ppc", ppc);
    context.refresh();
    context.getBeanFactory().initializeBean(formattingService, "formattingService");
    formattingService.addFormatterForFieldAnnotation(new JodaDateTimeFormatAnnotationFormatterFactory());
    doTestFormatFieldForAnnotation(ModelWithPlaceholders.class, false);
  }
View Full Code Here

Examples of org.springframework.format.datetime.joda.JodaDateTimeFormatAnnotationFormatterFactory

    assertNull(formattingService.convert("", TypeDescriptor.valueOf(String.class), TypeDescriptor.valueOf(Integer.class)));
  }

  @Test
  public void testFormatFieldForAnnotationWithSubclassAsFieldType() throws Exception {
    formattingService.addFormatterForFieldAnnotation(new JodaDateTimeFormatAnnotationFormatterFactory() {
      @Override
      public Printer<?> getPrinter(org.springframework.format.annotation.DateTimeFormat annotation, Class<?> fieldType) {
        assertEquals(MyDate.class, fieldType);
        return super.getPrinter(annotation, fieldType);
      }
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.