polish
This commit is contained in:
parent
3ef485bbbe
commit
5c3e71d494
|
|
@ -40,7 +40,6 @@ public class ConverterNotFoundException extends ConversionException {
|
||||||
this.targetType = targetType;
|
this.targetType = targetType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the source type that was requested to convert from.
|
* Returns the source type that was requested to convert from.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@ public class TypeDescriptor {
|
||||||
*/
|
*/
|
||||||
public static final TypeDescriptor NULL = new TypeDescriptor();
|
public static final TypeDescriptor NULL = new TypeDescriptor();
|
||||||
|
|
||||||
|
|
||||||
private Class<?> type;
|
private Class<?> type;
|
||||||
|
|
||||||
private MethodParameter methodParameter;
|
private MethodParameter methodParameter;
|
||||||
|
|
@ -51,7 +50,6 @@ public class TypeDescriptor {
|
||||||
|
|
||||||
private Annotation[] cachedFieldAnnotations;
|
private Annotation[] cachedFieldAnnotations;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new descriptor for the given type.
|
* Create a new descriptor for the given type.
|
||||||
* <p>Use this constructor when a conversion point comes from a source such as a Map
|
* <p>Use this constructor when a conversion point comes from a source such as a Map
|
||||||
|
|
@ -90,7 +88,6 @@ public class TypeDescriptor {
|
||||||
private TypeDescriptor() {
|
private TypeDescriptor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the wrapped MethodParameter, if any.
|
* Return the wrapped MethodParameter, if any.
|
||||||
* <p>Note: Either MethodParameter or Field is available.
|
* <p>Note: Either MethodParameter or Field is available.
|
||||||
|
|
@ -132,8 +129,8 @@ public class TypeDescriptor {
|
||||||
* Determine the declared type of the wrapped parameter/field.
|
* Determine the declared type of the wrapped parameter/field.
|
||||||
* Returns the Object wrapper type if the underlying type is a primitive.
|
* Returns the Object wrapper type if the underlying type is a primitive.
|
||||||
*/
|
*/
|
||||||
public Class getObjectType() {
|
public Class<?> getObjectType() {
|
||||||
Class type = getType();
|
Class<?> type = getType();
|
||||||
return type != null ? ClassUtils.resolvePrimitiveIfNecessary(type) : type;
|
return type != null ? ClassUtils.resolvePrimitiveIfNecessary(type) : type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -336,8 +333,7 @@ public class TypeDescriptor {
|
||||||
* @param type the class
|
* @param type the class
|
||||||
* @return the type descriptor
|
* @return the type descriptor
|
||||||
*/
|
*/
|
||||||
public static TypeDescriptor valueOf(Class type) {
|
public static TypeDescriptor valueOf(Class<?> type) {
|
||||||
// TODO needs a cache for common type descriptors
|
|
||||||
return (type != null ? new TypeDescriptor(type) : NULL);
|
return (type != null ? new TypeDescriptor(type) : NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue