Example usage for org.springframework.format FormatterRegistry addFormatter

List of usage examples for org.springframework.format FormatterRegistry addFormatter

Introduction

In this page you can find the example usage for org.springframework.format FormatterRegistry addFormatter.

Prototype

void addFormatter(Formatter<?> formatter);

Source Link

Document

Adds a Formatter to format fields of a specific type.

Usage

From source file:com.zeroone.guestebook.MvcConfig.java

@Override
public void addFormatters(FormatterRegistry registry) {
    registry.addFormatter(new DateFormatter(messageSource()));
}

From source file:sample.web.WebMvcConfiguration.java

@Override
public void addFormatters(FormatterRegistry registry) {
    super.addFormatters(registry);
    registry.addFormatter(new AmountFormatter());
    registry.addFormatter(new LocalDateTimeFormatter());
}

From source file:org.homiefund.config.MvcConfiguration.java

@Override
public void addFormatters(FormatterRegistry registry) {
    registry.addFormatter(new UserFormatter());
}

From source file:com.caocao.server.extend.CustomDateFormatterRegistrar.java

public void registerFormatters(FormatterRegistry registry) {
    addDateConverters(registry);//from  w ww  .j a  v  a  2  s . com
    if (this.dateFormatter != null) {
        registry.addFormatter(this.dateFormatter);
        registry.addFormatterForFieldType(Calendar.class, this.dateFormatter);
    }
    registry.addFormatterForFieldAnnotation(new DateTimeFormatAnnotationFormatterFactory());
}

From source file:com.pw.ism.DevMvcConfiguration.java

@Override
public void addFormatters(FormatterRegistry formatterRegistry) {
    formatterRegistry.addFormatter(new UserProfileFormatter());
}

From source file:cz.muni.fi.editor.webapp.config.MvcConfiguration.java

@Override
public void addFormatters(FormatterRegistry registry) {
    registry.addFormatter(new UserPermissionFormatter());
    registry.addFormatter(new OrganizationFormatter());
}

From source file:de.interseroh.report.webconfig.WebMvcConfig.java

@Override
public void addFormatters(FormatterRegistry registry) {
    super.addFormatters(registry);
    registry.addFormatter(new SelectionOptionFormatter());
    registry.addFormatter(new TimeFormatter());
    registry.addFormatter(new DateFormatter());
    registry.addFormatter(new TimestampFormatter());
}

From source file:org.consultjr.mvc.core.config.ApplicationConfig.java

@Override
public void addFormatters(FormatterRegistry registry) {
    super.addFormatters(registry); //To change body of generated methods, choose Tools | Templates.
    registry.addFormatter(new DateFormatter());
    registry.addFormatter(ActivityTypeFormatter.getInstance());
    registry.addFormatter(UserFormatter.getInstance());
}

From source file:net.sf.sze.config.WebMvcConfig.java

@Override
public void addFormatters(FormatterRegistry registry) {
    registry.addFormatterForFieldAnnotation(new NonEmptyStringAnnotationFormatterFactory());
    registry.addFormatter(new DateFormatter());
    registry.addConverter(new KlasseConverter());
    registry.addConverter(new ZeugnisFormularConverter());
    registry.addConverter(new SchulfachConverter());
    super.addFormatters(registry);
}

From source file:org.springframework.data.web.config.SpringDataWebConfiguration.java

@Override
public void addFormatters(FormatterRegistry registry) {

    registry.addFormatter(DistanceFormatter.INSTANCE);
    registry.addFormatter(PointFormatter.INSTANCE);

    if (!(registry instanceof FormattingConversionService)) {
        return;//from  w ww.java2 s  .c  om
    }

    FormattingConversionService conversionService = (FormattingConversionService) registry;

    DomainClassConverter<FormattingConversionService> converter = new DomainClassConverter<>(conversionService);
    converter.setApplicationContext(context);
}