类 DateFormatterRegistrar
- java.lang.Object
- org.springframework.format.datetime.DateFormatterRegistrar
- 所有已实现的接口:
FormatterRegistrar
public class DateFormatterRegistrar extends Object implements FormatterRegistrar
Configures basic date formatting for use with Spring, primarily forDateTimeFormatdeclarations. Applies to fields of typeDate,Calendarandlong.Designed for direct instantiation but also exposes the static
addDateConverters(ConverterRegistry)utility method for ad-hoc use against anyConverterRegistryinstance.- 从以下版本开始:
- 3.2
- 作者:
- Phillip Webb
- 另请参阅:
DateTimeFormatterRegistrar,JodaTimeFormatterRegistrar,FormatterRegistrar.registerFormatters(org.springframework.format.FormatterRegistry)
构造器概要
构造器 构造器 说明 DateFormatterRegistrar()
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static voidaddDateConverters(ConverterRegistry converterRegistry)Add date converters to the specified registry.voidregisterFormatters(FormatterRegistry registry)Register Formatters and Converters with a FormattingConversionService through a FormatterRegistry SPI.voidsetFormatter(DateFormatter dateFormatter)Set a global date formatter to register.
构造器详细资料
DateFormatterRegistrar
public DateFormatterRegistrar()
方法详细资料
setFormatter
public void setFormatter(DateFormatter dateFormatter)
registerFormatters
public void registerFormatters(FormatterRegistry registry)
从接口复制的说明:FormatterRegistrarRegister Formatters and Converters with a FormattingConversionService through a FormatterRegistry SPI.- 指定者:
registerFormatters在接口中FormatterRegistrar- 参数:
registry- the FormatterRegistry instance to use.
addDateConverters
public static void addDateConverters(ConverterRegistry converterRegistry)
Add date converters to the specified registry.- 参数:
converterRegistry- the registry of converters to add to