类 FormattingConversionService

java.lang.Object
cn.taketoday.core.conversion.support.GenericConversionService
cn.taketoday.format.support.FormattingConversionService
所有已实现的接口:
Aware, EmbeddedValueResolverAware, cn.taketoday.core.conversion.ConversionService, cn.taketoday.core.conversion.ConverterRegistry, cn.taketoday.core.conversion.support.ConfigurableConversionService, FormatterRegistry
直接已知子类:
ApplicationConversionService, DefaultFormattingConversionService

public class FormattingConversionService extends cn.taketoday.core.conversion.support.GenericConversionService implements FormatterRegistry, EmbeddedValueResolverAware
A ConversionService implementation designed to be configured as a FormatterRegistry.
从以下版本开始:
4.0
作者:
Keith Donald, Juergen Hoeller, Harry Yang
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    addFormatter(Formatter<?> formatter)
    Adds a Formatter to format fields of a specific type.
    void
    Adds a Formatter to format fields annotated with a specific format annotation.
    void
    addFormatterForFieldType(Class<?> fieldType, Formatter<?> formatter)
    Adds a Formatter to format fields of the given type.
    void
    addFormatterForFieldType(Class<?> fieldType, Printer<?> printer, Parser<?> parser)
    Adds a Printer/Parser pair to format fields of a specific type.
    void
    addParser(Parser<?> parser)
    Adds a Parser to parse fields of a specific type.
    void
    addPrinter(Printer<?> printer)
    Adds a Printer to print fields of a specific type.
    void
    setEmbeddedValueResolver(cn.taketoday.core.StringValueResolver resolver)
    Set the StringValueResolver to use for resolving embedded definition values.

    从类继承的方法 cn.taketoday.core.conversion.support.GenericConversionService

    addConverter, addConverter, addConverter, addConverterFactory, canBypassConvert, canConvert, canConvert, convert, convert, convert, convertNullSource, getConverter, getDefaultConverter, removeConvertible, toString

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    从接口继承的方法 cn.taketoday.core.conversion.ConversionService

    getConverter, getConverter, getConverter, getConverter

    从接口继承的方法 cn.taketoday.core.conversion.ConverterRegistry

    addConverter, addConverter, addConverter, addConverterFactory, removeConvertible
  • 构造器详细资料

    • FormattingConversionService

      public FormattingConversionService()
  • 方法详细资料

    • setEmbeddedValueResolver

      public void setEmbeddedValueResolver(@Nullable cn.taketoday.core.StringValueResolver resolver)
      从接口复制的说明: EmbeddedValueResolverAware
      Set the StringValueResolver to use for resolving embedded definition values.
      指定者:
      setEmbeddedValueResolver 在接口中 EmbeddedValueResolverAware
    • addPrinter

      public void addPrinter(Printer<?> printer)
      从接口复制的说明: FormatterRegistry
      Adds a Printer to print fields of a specific type. The field type is implied by the parameterized Printer instance.
      指定者:
      addPrinter 在接口中 FormatterRegistry
      参数:
      printer - the printer to add
      另请参阅:
    • addParser

      public void addParser(Parser<?> parser)
      从接口复制的说明: FormatterRegistry
      Adds a Parser to parse fields of a specific type. The field type is implied by the parameterized Parser instance.
      指定者:
      addParser 在接口中 FormatterRegistry
      参数:
      parser - the parser to add
      另请参阅:
    • addFormatter

      public void addFormatter(Formatter<?> formatter)
      从接口复制的说明: FormatterRegistry
      Adds a Formatter to format fields of a specific type. The field type is implied by the parameterized Formatter instance.
      指定者:
      addFormatter 在接口中 FormatterRegistry
      参数:
      formatter - the formatter to add
      另请参阅:
    • addFormatterForFieldType

      public void addFormatterForFieldType(Class<?> fieldType, Formatter<?> formatter)
      从接口复制的说明: FormatterRegistry
      Adds a Formatter to format fields of the given type.

      On print, if the Formatter's type T is declared and fieldType is not assignable to T, a coercion to T will be attempted before delegating to formatter to print a field value. On parse, if the parsed object returned by formatter is not assignable to the runtime field type, a coercion to the field type will be attempted before returning the parsed field value.

      指定者:
      addFormatterForFieldType 在接口中 FormatterRegistry
      参数:
      fieldType - the field type to format
      formatter - the formatter to add
    • addFormatterForFieldType

      public void addFormatterForFieldType(Class<?> fieldType, Printer<?> printer, Parser<?> parser)
      从接口复制的说明: FormatterRegistry
      Adds a Printer/Parser pair to format fields of a specific type. The formatter will delegate to the specified printer for printing and the specified parser for parsing.

      On print, if the Printer's type T is declared and fieldType is not assignable to T, a coercion to T will be attempted before delegating to printer to print a field value. On parse, if the object returned by the Parser is not assignable to the runtime field type, a coercion to the field type will be attempted before returning the parsed field value.

      指定者:
      addFormatterForFieldType 在接口中 FormatterRegistry
      参数:
      fieldType - the field type to format
      printer - the printing part of the formatter
      parser - the parsing part of the formatter
    • addFormatterForFieldAnnotation

      public void addFormatterForFieldAnnotation(AnnotationFormatterFactory<? extends Annotation> annotationFormatterFactory)
      从接口复制的说明: FormatterRegistry
      Adds a Formatter to format fields annotated with a specific format annotation.
      指定者:
      addFormatterForFieldAnnotation 在接口中 FormatterRegistry
      参数:
      annotationFormatterFactory - the annotation formatter factory to add