接口的使用
org.springframework.format.Printer
使用Printer的程序包 程序包 说明 org.springframework.format An API for defining Formatters to format field model values for display in a UI.org.springframework.format.datetime Formatters forjava.util.Date
properties.org.springframework.format.datetime.joda Integration with Joda-Time for formatting Joda date and time types as well as standard JDK Date types.org.springframework.format.datetime.standard Integration with the JSR-310java.time
package in JDK 8.org.springframework.format.number Formatters forjava.lang.Number
properties.org.springframework.format.number.money Integration with the JSR-354javax.money
package.org.springframework.format.support Support classes for the formatting package, providing common implementations as well as adapters.org.springframework.format中Printer的使用
org.springframework.format中Printer的子接口 修饰符和类型 接口 说明 interface
Formatter<T>
Formats objects of type T.返回Printer的org.springframework.format中的方法 修饰符和类型 方法 说明 Printer<?>
AnnotationFormatterFactory. getPrinter(A annotation, Class<?> fieldType)
Get the Printer to print the value of a field offieldType
annotated withannotation
.参数类型为Printer的org.springframework.format中的方法 修饰符和类型 方法 说明 void
FormatterRegistry. addFormatterForFieldType(Class<?> fieldType, Printer<?> printer, Parser<?> parser)
Adds a Printer/Parser pair to format fields of a specific type.void
FormatterRegistry. addPrinter(Printer<?> printer)
Adds a Printer to print fields of a specific type.org.springframework.format.datetime中Printer的使用
实现Printer的org.springframework.format.datetime中的类 修饰符和类型 类 说明 class
DateFormatter
A formatter forDate
types.返回Printer的org.springframework.format.datetime中的方法 修饰符和类型 方法 说明 Printer<?>
DateTimeFormatAnnotationFormatterFactory. getPrinter(DateTimeFormat annotation, Class<?> fieldType)
org.springframework.format.datetime.joda中Printer的使用
实现Printer的org.springframework.format.datetime.joda中的类 修饰符和类型 类 说明 class
MillisecondInstantPrinter
Prints Long instances using a JodaDateTimeFormatter
.class
ReadableInstantPrinter
Prints Joda-TimeReadableInstant
instances using aDateTimeFormatter
.class
ReadablePartialPrinter
Prints Joda-TimeReadablePartial
instances using aDateTimeFormatter
.返回Printer的org.springframework.format.datetime.joda中的方法 修饰符和类型 方法 说明 Printer<?>
JodaDateTimeFormatAnnotationFormatterFactory. getPrinter(DateTimeFormat annotation, Class<?> fieldType)
org.springframework.format.datetime.standard中Printer的使用
实现Printer的org.springframework.format.datetime.standard中的类 修饰符和类型 类 说明 class
InstantFormatter
Formatter
implementation for a JSR-310Instant
, following JSR-310's parsing rules for an Instant (that is, not using a configurableDateTimeFormatter
): accepting the defaultISO_INSTANT
format as well asRFC_1123_DATE_TIME
(which is commonly used for HTTP date header values), as of Spring 4.3.class
TemporalAccessorPrinter
Printer
implementation for a JSR-310TemporalAccessor
, using aDateTimeFormatter
) (the contextual one, if available).返回Printer的org.springframework.format.datetime.standard中的方法 修饰符和类型 方法 说明 Printer<?>
Jsr310DateTimeFormatAnnotationFormatterFactory. getPrinter(DateTimeFormat annotation, Class<?> fieldType)
org.springframework.format.number中Printer的使用
实现Printer的org.springframework.format.number中的类 修饰符和类型 类 说明 class
AbstractNumberFormatter
Abstract formatter for Numbers, providing aAbstractNumberFormatter.getNumberFormat(java.util.Locale)
template method.class
CurrencyStyleFormatter
A BigDecimal formatter for number values in currency style.class
NumberStyleFormatter
A general-purpose number formatter using NumberFormat's number style.class
PercentStyleFormatter
A formatter for number values in percent style.返回Printer的org.springframework.format.number中的方法 修饰符和类型 方法 说明 Printer<Number>
NumberFormatAnnotationFormatterFactory. getPrinter(NumberFormat annotation, Class<?> fieldType)
org.springframework.format.number.money中Printer的使用
实现Printer的org.springframework.format.number.money中的类 修饰符和类型 类 说明 class
CurrencyUnitFormatter
Formatter for JSR-354CurrencyUnit
values, from and to currency code Strings.class
MonetaryAmountFormatter
Formatter for JSR-354MonetaryAmount
values, delegating toMonetaryAmountFormat.format(javax.money.MonetaryAmount)
andMonetaryAmountFormat.parse(java.lang.CharSequence)
.返回Printer的org.springframework.format.number.money中的方法 修饰符和类型 方法 说明 Printer<javax.money.MonetaryAmount>
Jsr354NumberFormatAnnotationFormatterFactory. getPrinter(NumberFormat annotation, Class<?> fieldType)
org.springframework.format.support中Printer的使用
参数类型为Printer的org.springframework.format.support中的方法 修饰符和类型 方法 说明 void
FormattingConversionService. addFormatterForFieldType(Class<?> fieldType, Printer<?> printer, Parser<?> parser)
void
FormattingConversionService. addPrinter(Printer<?> printer)