Close

Spring Framework - Default Formatters and Converter list

Spring Framework 

This examples shows how to find out formatter and converters registered with a ConversionService by default. Spring version: 4.3.4

package com.logicbig.example;

import org.springframework.core.convert.ConversionService;
import org.springframework.core.convert.support.DefaultConversionService;
import org.springframework.format.support.DefaultFormattingConversionService;
import org.springframework.format.support.FormattingConversionService;

public class DefaultFormatterListExample {
public static void main (String[] args) {

ConversionService service = new DefaultConversionService();
System.out.println("----- list for DefaultConversionService -----");
System.out.println(service);

service = new DefaultFormattingConversionService();
System.out.println("----- list for DefaultFormattingConversionService -----");
System.out.println(service);

service = new FormattingConversionService();
System.out.println("----- list for FormattingConversionService -----");
System.out.println(service);


}
}

Output

----- list for DefaultConversionService -----
ConversionService converters =

----- list for DefaultFormattingConversionService -----
ConversionService converters =

----- list for FormattingConversionService -----
ConversionService converters =
Original Post




See Also