org.springframework.ui.format.support
Class FormattingConversionServiceAdapter

java.lang.Object
  extended by org.springframework.core.convert.support.GenericConversionService
      extended by org.springframework.ui.format.support.FormattingConversionServiceAdapter
All Implemented Interfaces:
ConversionService, ConverterRegistry

public class FormattingConversionServiceAdapter
extends GenericConversionService

Adapter that exposes a ConversionService reference for a given FormatterRegistry, retrieving the current Locale from LocaleContextHolder.

Since:
3.0
Author:
Juergen Hoeller

Constructor Summary
FormattingConversionServiceAdapter(FormatterRegistry formatterRegistry)
          Create a new FormattingConversionServiceAdapter for the given FormatterRegistry.
 
Method Summary
protected  GenericConverter getConverter(TypeDescriptor sourceType, TypeDescriptor targetType)
          Hook method to lookup the converter for a given sourceType/targetType pair.
 
Methods inherited from class org.springframework.core.convert.support.GenericConversionService
addConverter, addConverterFactory, addGenericConverter, canConvert, canConvert, convert, convert, convertNull, getParent, removeConvertible, setConverterFactories, setConverters, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormattingConversionServiceAdapter

public FormattingConversionServiceAdapter(FormatterRegistry formatterRegistry)
Create a new FormattingConversionServiceAdapter for the given FormatterRegistry.

Parameters:
formatterRegistry - the FormatterRegistry to wrap
Method Detail

getConverter

protected GenericConverter getConverter(TypeDescriptor sourceType,
                                        TypeDescriptor targetType)
Description copied from class: GenericConversionService
Hook method to lookup the converter for a given sourceType/targetType pair. First queries this ConversionService's converter map. If no suitable Converter is found, and a parent is set, then queries the parent. If still no suitable Converter is found, returns a NO_OP Converter if the sourceType and targetType are assignable. Returns null if this ConversionService simply cannot convert between sourceType and targetType. Subclasses may override.

Overrides:
getConverter in class GenericConversionService
Parameters:
sourceType - the source type to convert from
targetType - the target type to convert to
Returns:
the generic converter that will perform the conversion, or null if no suitable converter was found