接口的使用
cn.taketoday.core.conversion.GenericConverter
使用GenericConverter的程序包
程序包
说明
Type Conversion System
Default implementation of the type conversion system.
-
cn.taketoday.core.conversion中GenericConverter的使用
修饰符和类型接口说明interfaceAGenericConverterthat may conditionally execute based on attributes of thesourceandtargetTypeDescriptor.修饰符和类型方法说明ConversionService.getConverter(TypeDescriptor sourceType, TypeDescriptor targetType) Hook method to lookup the converter for a given sourceType/targetType pair.default GenericConverterConversionService.getConverter(Class<?> sourceType, TypeDescriptor targetType) Hook method to lookup the converter for a given sourceType/targetType pair.default GenericConverterConversionService.getConverter(Class<?> sourceType, Class<?> targetType) Hook method to lookup the converter for a given sourceType/targetType pair.default GenericConverterConversionService.getConverter(Object sourceObject, TypeDescriptor targetType) Hook method to lookup the converter for a given sourceType/targetType pair.default GenericConverterConversionService.getConverter(Object sourceObject, Class<?> targetType) Hook method to lookup the converter for a given sourceType/targetType pair.修饰符和类型方法说明voidConverterRegistry.addConverter(GenericConverter converter) Add a generic converter to this registry. -
cn.taketoday.core.conversion.support中GenericConverter的使用
修饰符和类型类说明(专用程序包) final classConverts an array to another array.(专用程序包) final classConverts an array to a Collection.(专用程序包) final classConverts an array to an Object by returning the first array element after converting it to the desired target type.(专用程序包) final classConverts an array to a comma-delimited String.(专用程序包) final classConverts aByteBufferdirectly to and frombyte[] ByteBufferdirectly to and frombyte[]sand indirectly to any type that theConversionServicesupport viabyte[].(专用程序包) final classConverts a Collection to an array.(专用程序包) final classConverts from a Collection to another Collection.(专用程序包) final classConverts a Collection to an Object by returning the first collection element after converting it to the desired targetType.(专用程序包) final classConverts a Collection to a comma-delimited String.(专用程序包) final classSimply callsObject.toString()to convert any supported object to aString.private final classAdapts aConverterto aGenericConverter.private final classAdapts aConverterFactoryto aGenericConverter.private static final recordInternal converter that performs no operation.(专用程序包) final classConverts an entity identifier to a entity reference by calling a static finder method on the target entity type.(专用程序包) final classConverts a Map to another Map.(专用程序包) final classConverts an Object to a single-element array containing the Object.(专用程序包) final classConverts an Object to a single-element Collection containing the Object.(专用程序包) final classGeneric converter that uses conventions to convert a source object to atargetTypeby delegating to a method on the source object or to a static factory method or constructor on thetargetType.(专用程序包) final classConvert an Object tojava.util.Optional<T>if necessary using theConversionServiceto convert the source Object to the generic type of Optional when known.(专用程序包) classConverts aStreamto and from a collection or array, converting the element type if necessary.(专用程序包) final classConverts a comma-delimited String to an Array.(专用程序包) final classConverts a comma-delimited String to a Collection.修饰符和类型字段说明private static final GenericConverterGenericConversionService.NO_MATCHUsed as a cache entry when no converter is available.private static final GenericConverterGenericConversionService.NO_OP_CONVERTERGeneral NO-OP converter used when conversion is not required.修饰符和类型字段说明private final ConcurrentReferenceHashMap<GenericConversionService.ConverterCacheKey,GenericConverter> GenericConversionService.converterCacheprivate final ConcurrentLinkedDeque<GenericConverter>GenericConversionService.ConvertersForPair.convertersprivate final CopyOnWriteArraySet<GenericConverter>GenericConversionService.Converters.globalConverters修饰符和类型方法说明GenericConversionService.Converters.find(TypeDescriptor sourceType, TypeDescriptor targetType) Find aGenericConvertergiven a source and target type.GenericConversionService.ConvertersForPair.getConverter(TypeDescriptor sourceType, TypeDescriptor targetType) GenericConversionService.getConverter(TypeDescriptor sourceType, TypeDescriptor targetType) Hook method to lookup the converter for a given sourceType/targetType pair.protected GenericConverterGenericConversionService.getDefaultConverter(TypeDescriptor sourceType, TypeDescriptor targetType) Return the default converter if no converter is found for the given sourceType/targetType pair.private GenericConverterGenericConversionService.Converters.getRegisteredConverter(TypeDescriptor sourceType, TypeDescriptor targetType, GenericConverter.ConvertiblePair convertiblePair) 修饰符和类型方法说明voidGenericConversionService.Converters.add(GenericConverter converter) voidGenericConversionService.ConvertersForPair.add(GenericConverter converter) voidGenericConversionService.addConverter(GenericConverter converter) static ObjectConversionUtils.invokeConverter(GenericConverter converter, Object source, TypeDescriptor sourceType, TypeDescriptor targetType)