类的使用
cn.taketoday.core.TypeDescriptor
使用TypeDescriptor的程序包
程序包
说明
Provides core helpers that are not specific to any part of the framework.
Type Conversion System
Default implementation of the type conversion system.
Core abstractions behind the Spring Expression Language.
Common utility classes behind the Spring Expression Language.
SpEL's central implementation package.
SpEL's standard parser implementation.
SpEL's default implementations for various core abstractions.
Optimised Reflection System
-
cn.taketoday.core中TypeDescriptor的使用
修饰符和类型方法说明static TypeDescriptorTypeDescriptor.array(TypeDescriptor elementDescriptor) Create a new type descriptor as an array of the specified type.static TypeDescriptorTypeDescriptor.collection(Class<?> collectionType, TypeDescriptor elementDescriptor) Create a new type descriptor from aCollectiontype.static TypeDescriptorTypeDescriptor.collection(Class<?> collectionType, Class<?> element) TypeDescriptor.elementDescriptor(Object element) If this type is aCollectionor an array, creates a element TypeDescriptor from the provided collection or array element.static TypeDescriptorTypeDescriptor.forParameter(Executable executable, int parameterIndex) static TypeDescriptorstatic TypeDescriptorTypeDescriptor.fromObject(Object source) Create a new type descriptor for an object.static TypeDescriptorTypeDescriptor.fromParameter(Parameter parameter) TypeDescriptor.getElementDescriptor()If this type is an array, returns the array's component type.TypeDescriptor.getMapKeyDescriptor()If this type is aMapand its key type is parameterized, returns the map's key type.TypeDescriptor.getMapKeyDescriptor(Object mapKey) If this type is aMap, creates a mapKeyTypeDescriptorfrom the provided map key.TypeDescriptor.getMapValueDescriptor()If this type is aMapand its value type is parameterized, returns the map's value type.TypeDescriptor.getMapValueDescriptor(Object mapValue) If this type is aMap, creates a mapValueTypeDescriptorfrom the provided map value.static TypeDescriptorTypeDescriptor.map(Class<?> mapType, TypeDescriptor keyDescriptor, TypeDescriptor valueDescriptor) Create a new type descriptor from aMaptype.static TypeDescriptorNarrows thisTypeDescriptorby setting its type to the class of the provided value.static TypeDescriptorTypeDescriptor.nested(MethodParameter methodParameter, int nestingLevel) Create a type descriptor for a nested type declared within the method parameter.static TypeDescriptorTypeDescriptor.nested(TypeDescriptor typeDescriptor, int nestingLevel) static TypeDescriptorCreate a type descriptor for a nested type declared within the field.Cast thisTypeDescriptorto a superclass or implemented interface preserving annotations and nested type context.static TypeDescriptorCreate a new type descriptor from the given type.参数类型为TypeDescriptor的cn.taketoday.core中的方法修饰符和类型方法说明static TypeDescriptorTypeDescriptor.array(TypeDescriptor elementDescriptor) Create a new type descriptor as an array of the specified type.static TypeDescriptorTypeDescriptor.collection(Class<?> collectionType, TypeDescriptor elementDescriptor) Create a new type descriptor from aCollectiontype.booleanTypeDescriptor.isAssignableTo(TypeDescriptor typeDescriptor) Returns true if an object of this type descriptor can be assigned to the location described by the given type descriptor.static TypeDescriptorTypeDescriptor.map(Class<?> mapType, TypeDescriptor keyDescriptor, TypeDescriptor valueDescriptor) Create a new type descriptor from aMaptype.static TypeDescriptorTypeDescriptor.nested(TypeDescriptor typeDescriptor, int nestingLevel) -
cn.taketoday.core.conversion中TypeDescriptor的使用
修饰符和类型方法说明ConversionFailedException.getSourceType()Return the source type we tried to convert the value from.ConverterNotFoundException.getSourceType()Return the source type that was requested to convert from.ConversionFailedException.getTargetType()Return the target type we tried to convert the value to.ConverterNotFoundException.getTargetType()Return the target type that was requested to convert to.修饰符和类型方法说明booleanConversionService.canConvert(TypeDescriptor sourceType, TypeDescriptor targetType) Returntrueif objects ofsourceTypecan be converted to thetargetType.<T> TConversionService.convert(Object source, TypeDescriptor targetType) Convert the givensourceto the specifiedtargetType.ConversionService.convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) Convert the givensourceto the specifiedtargetType.GenericConverter.convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) Convert the source object to the targetType described by theTypeDescriptor.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(Object sourceObject, TypeDescriptor targetType) Hook method to lookup the converter for a given sourceType/targetType pair.booleanConditionalConverter.matches(TypeDescriptor sourceType, TypeDescriptor targetType) Should the conversion fromsourceTypetotargetTypecurrently under consideration be selected?参数类型为TypeDescriptor的cn.taketoday.core.conversion中的构造器限定符构造器说明ConversionFailedException(TypeDescriptor sourceType, TypeDescriptor targetType, Object value, Throwable cause) Create a new conversion exception.ConverterNotFoundException(TypeDescriptor sourceType, TypeDescriptor targetType) Create a new conversion executor not found exception. -
cn.taketoday.core.conversion.support中TypeDescriptor的使用
修饰符和类型方法说明booleanGenericConversionService.canBypassConvert(TypeDescriptor sourceType, TypeDescriptor targetType) Return whether conversion between the source type and the target type can be bypassed.booleanGenericConversionService.canConvert(TypeDescriptor sourceType, TypeDescriptor targetType) <T> TGenericConversionService.convert(Object source, TypeDescriptor targetType) Convenience operation for converting a source object to the specified targetType, where the target type is a descriptor that provides additional conversion context.GenericConversionService.convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) protected ObjectGenericConversionService.convertNullSource(TypeDescriptor sourceType, TypeDescriptor targetType) Template method to convert anullsource.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.限定符构造器说明ConvertingPropertyEditorAdapter(ConversionService conversionService, TypeDescriptor targetDescriptor) Create a new ConvertingPropertyEditorAdapter for a givenConversionServiceand the given target type. -
cn.taketoday.expression中TypeDescriptor的使用
修饰符和类型方法说明TypedValue.getTypeDescriptor()Expression.getValueTypeDescriptor()Return the most general type that can be passed to aExpression.setValue(java.lang.Object, java.lang.Object)method using the default context.Expression.getValueTypeDescriptor(EvaluationContext context) Return the most general type that can be passed to theExpression.setValue(EvaluationContext, Object)method for the given context.Expression.getValueTypeDescriptor(EvaluationContext context, Object rootObject) Return the most general type that can be passed to theExpression.setValue(EvaluationContext, Object, Object)method for the given context.Expression.getValueTypeDescriptor(Object rootObject) Return the most general type that can be passed to theExpression.setValue(Object, Object)method using the default context.参数类型为TypeDescriptor的cn.taketoday.expression中的方法修饰符和类型方法说明booleanTypeConverter.canConvert(TypeDescriptor sourceType, TypeDescriptor targetType) Returntrueif the type converter can convert the specified type to the desired target type.TypeConverter.convertValue(Object value, TypeDescriptor sourceType, TypeDescriptor targetType) Convert (or coerce) a value from one type to another, for example from abooleanto aString.类型变量类型为TypeDescriptor的cn.taketoday.expression中的方法参数修饰符和类型方法说明ConstructorResolver.resolve(EvaluationContext context, String typeName, List<TypeDescriptor> argumentTypes) Within the supplied context determine a suitable constructor on the supplied type that can handle the specified arguments.MethodResolver.resolve(EvaluationContext context, Object targetObject, String name, List<TypeDescriptor> argumentTypes) Within the supplied context determine a suitable method on the supplied object that can handle the specified arguments.参数类型为TypeDescriptor的cn.taketoday.expression中的构造器限定符构造器说明TypedValue(Object value, TypeDescriptor typeDescriptor) Create aTypedValuefor a particular value with a particularTypeDescriptorwhich may contain additional generic declarations. -
cn.taketoday.expression.common中TypeDescriptor的使用
修饰符和类型方法说明CompositeStringExpression.getValueTypeDescriptor()CompositeStringExpression.getValueTypeDescriptor(EvaluationContext context) CompositeStringExpression.getValueTypeDescriptor(EvaluationContext context, Object rootObject) CompositeStringExpression.getValueTypeDescriptor(Object rootObject) LiteralExpression.getValueTypeDescriptor()LiteralExpression.getValueTypeDescriptor(EvaluationContext context) LiteralExpression.getValueTypeDescriptor(EvaluationContext context, Object rootObject) LiteralExpression.getValueTypeDescriptor(Object rootObject) -
cn.taketoday.expression.spel中TypeDescriptor的使用
修饰符和类型方法说明ExpressionState.convertValue(TypedValue value, TypeDescriptor targetTypeDescriptor) ExpressionState.convertValue(Object value, TypeDescriptor targetTypeDescriptor) -
cn.taketoday.expression.spel.standard中TypeDescriptor的使用
修饰符和类型方法说明SpelExpression.getValueTypeDescriptor()SpelExpression.getValueTypeDescriptor(EvaluationContext context) SpelExpression.getValueTypeDescriptor(EvaluationContext context, Object rootObject) SpelExpression.getValueTypeDescriptor(Object rootObject) -
cn.taketoday.expression.spel.support中TypeDescriptor的使用
修饰符和类型方法说明booleanStandardTypeConverter.canConvert(TypeDescriptor sourceType, TypeDescriptor targetType) StandardTypeConverter.convertValue(Object value, TypeDescriptor sourceType, TypeDescriptor targetType) voidStandardEvaluationContext.setRootObject(Object rootObject, TypeDescriptor typeDescriptor) SimpleEvaluationContext.Builder.withTypedRootObject(Object rootObject, TypeDescriptor typeDescriptor) Specify a typed root object to resolve against.类型变量类型为TypeDescriptor的cn.taketoday.expression.spel.support中的方法参数修饰符和类型方法说明static intReflectionHelper.getTypeDifferenceWeight(List<TypeDescriptor> paramTypes, List<TypeDescriptor> argTypes) Based onReflectiveMethodInvoker.getTypeDifferenceWeight(Class[], Object[])but operates on TypeDescriptors.DataBindingMethodResolver.resolve(EvaluationContext context, Object targetObject, String name, List<TypeDescriptor> argumentTypes) ReflectiveConstructorResolver.resolve(EvaluationContext context, String typeName, List<TypeDescriptor> argumentTypes) Locate a constructor on the type.ReflectiveMethodResolver.resolve(EvaluationContext context, Object targetObject, String name, List<TypeDescriptor> argumentTypes) Locate a method on a type. -
cn.taketoday.reflect中TypeDescriptor的使用
修饰符和类型方法说明protected TypeDescriptorProperty.createDescriptor()final TypeDescriptorProperty.getTypeDescriptor()ReturnsTypeDescriptorfor this property