类的使用
cc.shacocloud.mirage.utils.converter.TypeDescriptor
-
使用TypeDescriptor的程序包 程序包 说明 cc.shacocloud.mirage.utils.converter cc.shacocloud.mirage.utils.converter.support -
-
cc.shacocloud.mirage.utils.converter中TypeDescriptor的使用
类型参数类型为TypeDescriptor的cc.shacocloud.mirage.utils.converter中的字段 修饰符和类型 字段 说明 protected Map<TypeDescriptor,Conversion>TypeConverterSupportImpl. targetConverterCache返回TypeDescriptor的cc.shacocloud.mirage.utils.converter中的方法 修饰符和类型 方法 说明 static @Nullable TypeDescriptorTypeDescriptor. array(@Nullable TypeDescriptor elementTypeDescriptor)创建一个新的类型描述符,作为指定类型的一个数组。static @NotNull TypeDescriptorTypeDescriptor. collection(@NotNull Class<?> collectionType, @Nullable TypeDescriptor elementTypeDescriptor)从一个Collection类型创建一个新的类型描述符。@Nullable TypeDescriptorTypeDescriptor. elementTypeDescriptor(Object element)如果这个类型是一个Collection或一个数组,从提供的集合或数组元素中创建一个元素TypeDescriptorstatic @Nullable TypeDescriptorTypeDescriptor. forObject(@Nullable Object source)为一个对象创建一个新的类型描述符。@Nullable TypeDescriptorTypeDescriptor. getElementTypeDescriptor()如果该类型是一个数组,返回数组的组件类型。@Nullable TypeDescriptorTypeDescriptor. getMapKeyTypeDescriptor()如果这个类型是Map,并且它的键类型是参数化的,返回地图的键类型。@Nullable TypeDescriptorTypeDescriptor. getMapKeyTypeDescriptor(Object mapKey)如果这个类型是一个Map,则从提供的地图键中创建一个mapKeyTypeDescriptor@Nullable TypeDescriptorTypeDescriptor. getMapValueTypeDescriptor()如果这个类型是一个Map,并且它的值类型是参数化的,返回map的值类型。@Nullable TypeDescriptorTypeDescriptor. getMapValueTypeDescriptor(Object mapValue)如果这个类型是一个Map,则从提供的地图值中创建一个mapValueTypeDescriptorstatic @NotNull TypeDescriptorTypeDescriptor. map(@NotNull Class<?> mapType, @Nullable TypeDescriptor keyTypeDescriptor, @Nullable TypeDescriptor valueTypeDescriptor)从一个Map类型创建一个新的类型描述符。TypeDescriptorTypeDescriptor. narrow(@Nullable Object value)缩小这个TypeDescriptor,将其类型设置为提供的值的类别。static @Nullable TypeDescriptorTypeDescriptor. nested(MethodParameter methodParameter, int nestingLevel)为方法参数中声明的嵌套类型创建一个类型描述符。static @Nullable TypeDescriptorTypeDescriptor. nested(Field field, int nestingLevel)为字段内声明的嵌套类型创建一个类型描述符。@Nullable TypeDescriptorTypeDescriptor. upcast(@Nullable Class<?> superType)将这个TypeDescriptor投给一个超类或实现的接口,保留注释和嵌套的类型上下文。static @NotNull TypeDescriptorTypeDescriptor. valueOf(@Nullable Class<?> type)从给定的类型创建一个新的类型描述符参数类型为TypeDescriptor的cc.shacocloud.mirage.utils.converter中的方法 修饰符和类型 方法 说明 static @Nullable TypeDescriptorTypeDescriptor. array(@Nullable TypeDescriptor elementTypeDescriptor)创建一个新的类型描述符,作为指定类型的一个数组。static @NotNull TypeDescriptorTypeDescriptor. collection(@NotNull Class<?> collectionType, @Nullable TypeDescriptor elementTypeDescriptor)从一个Collection类型创建一个新的类型描述符。ObjectConversion. convert(@NotNull Object source, @NotNull TypeDescriptor sourceType, @NotNull TypeDescriptor targetType)将源对象转换为TypeDescriptor描述的目标类型default <T> TTypeConverter. convertIfNecessary(@Nullable Object source, @NotNull TypeDescriptor typeDescriptor)将该值转换为所需的类型<T> TTypeConverter. convertIfNecessary(@Nullable Object source, @Nullable Class<T> requiredType, @Nullable TypeDescriptor typeDescriptor)将该值转换为所需的类型<T> TTypeConverterSupportImpl. convertIfNecessary(@Nullable Object source, @Nullable Class<T> requiredType, @Nullable TypeDescriptor typeDescriptor)booleanTypeDescriptor. isAssignableTo(@NotNull TypeDescriptor typeDescriptor)如果这个类型描述符的对象可以被分配到给定类型描述符所描述的位置,则返回true。static @NotNull TypeDescriptorTypeDescriptor. map(@NotNull Class<?> mapType, @Nullable TypeDescriptor keyTypeDescriptor, @Nullable TypeDescriptor valueTypeDescriptor)从一个Map类型创建一个新的类型描述符。static @NotNull ConverterCacheKeyConverterCacheKey. of(TypeDescriptor sourceType, TypeDescriptor targetType)创建ConverterCacheKey对象的快捷方法voidConversionRegistry. registry(@NotNull TypeDescriptor targetType, @NotNull Conversion conversion)注册目标类型转换器voidConversionRegistry. registry(@NotNull TypeDescriptor sourceType, @NotNull TypeDescriptor targetType, @NotNull Conversion conversion)注册指定来源和目标类型转换器voidTypeConverterSupportImpl. registry(@NotNull TypeDescriptor targetType, @NotNull Conversion conversion)voidTypeConverterSupportImpl. registry(@NotNull TypeDescriptor sourceType, @NotNull TypeDescriptor targetType, @NotNull Conversion conversion)booleanConversionSupport. support(@NotNull TypeDescriptor sourceType, @NotNull TypeDescriptor targetType)判断是否可以将源对象类型转换为TypeDescriptor描述的目标类型参数类型为TypeDescriptor的cc.shacocloud.mirage.utils.converter中的构造器 构造器 说明 ConversionException(@NotNull TypeDescriptor sourceType, @NotNull TypeDescriptor targetType, @Nullable Object value)ConversionException(@NotNull TypeDescriptor sourceType, @NotNull TypeDescriptor targetType, @Nullable Object value, @NotNull String message)ConversionException(@NotNull TypeDescriptor sourceType, @NotNull TypeDescriptor targetType, @Nullable Object value, @NotNull String message, Throwable cause)ConversionException(@NotNull TypeDescriptor sourceType, @NotNull TypeDescriptor targetType, @Nullable Object value, Throwable cause)ConverterCacheKey(TypeDescriptor sourceType, TypeDescriptor targetType)NoSuchConversionException(@NotNull TypeDescriptor sourceType, @NotNull TypeDescriptor targetType, @Nullable Object value) -
cc.shacocloud.mirage.utils.converter.support中TypeDescriptor的使用
参数类型为TypeDescriptor的cc.shacocloud.mirage.utils.converter.support中的方法 修饰符和类型 方法 说明 ObjectToBooleanConversion. convert(@NotNull Object source, @NotNull TypeDescriptor sourceType, @NotNull TypeDescriptor targetType)ObjectToNumberConversion. convert(@NotNull Object source, @NotNull TypeDescriptor sourceType, @NotNull TypeDescriptor targetType)ObjectToStringConversion. convert(@NotNull Object source, @NotNull TypeDescriptor sourceType, @NotNull TypeDescriptor targetType)protected NumberToNumberConversion. internalConvert(@NotNull Object source, @NotNull TypeDescriptor sourceType, @NotNull TypeDescriptor targetType)内部的转换,用于子类继承拓展booleanToBooleanConversion. support(@NotNull TypeDescriptor sourceType, @NotNull TypeDescriptor targetType)booleanToNumberConversion. support(@NotNull TypeDescriptor sourceType, @NotNull TypeDescriptor targetType)booleanToStringConversion. support(@NotNull TypeDescriptor sourceType, @NotNull TypeDescriptor targetType)
-