Spring Framework FormatterRegistry - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework FormatterRegistry class.

This code example shows how to use the following methods:addFormatterForFieldAnnotation
	 * Add formatters appropriate for most environments, including number formatters and a Joda-Time 
	 * date formatter if Joda-Time is present on the classpath. 
	 * @param formatterRegistry the service to register default formatters against 
	public static void addDefaultFormatters(FormatterRegistry formatterRegistry) {
		formatterRegistry.addFormatterForFieldAnnotation(new NumberFormatAnnotationFormatterFactory());
		if (jsr310Present) {
			// just handling JSR-310 specific date and time types 
			new DateTimeFormatterRegistrar().registerFormatters(formatterRegistry);
		if (jodaTimePresent) {
			// handles Joda-specific types as well as Date, Calendar, Long 
			new JodaTimeFormatterRegistrar().registerFormatters(formatterRegistry);
		else { 
			// regular DateFormat-based Date, Calendar, Long converters 
			new DateFormatterRegistrar().registerFormatters(formatterRegistry);
See Code Examples for Spring Framework FormatterRegistry Methods: