|
|
|
@ -238,7 +238,7 @@ public class TypeDescriptor implements Serializable { |
|
|
|
* <p>As of Spring Framework 4.2, this method supports arbitrary levels |
|
|
|
* <p>As of Spring Framework 4.2, this method supports arbitrary levels |
|
|
|
* of meta-annotations. |
|
|
|
* of meta-annotations. |
|
|
|
* @param annotationType the annotation type |
|
|
|
* @param annotationType the annotation type |
|
|
|
* @return <tt>true</tt> if the annotation is present |
|
|
|
* @return {@code true} if the annotation is present |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean hasAnnotation(Class<? extends Annotation> annotationType) { |
|
|
|
public boolean hasAnnotation(Class<? extends Annotation> annotationType) { |
|
|
|
if (this.annotatedElement.isEmpty()) { |
|
|
|
if (this.annotatedElement.isEmpty()) { |
|
|
|
@ -273,8 +273,8 @@ public class TypeDescriptor implements Serializable { |
|
|
|
* On the other hand, {@code valueOf(Number.class).isAssignableTo(valueOf(Integer.class))} |
|
|
|
* On the other hand, {@code valueOf(Number.class).isAssignableTo(valueOf(Integer.class))} |
|
|
|
* returns {@code false} because, while all Integers are Numbers, not all Numbers are Integers. |
|
|
|
* returns {@code false} because, while all Integers are Numbers, not all Numbers are Integers. |
|
|
|
* <p>For arrays, collections, and maps, element and key/value types are checked if declared. |
|
|
|
* <p>For arrays, collections, and maps, element and key/value types are checked if declared. |
|
|
|
* For example, a List<String> field value is assignable to a Collection<CharSequence> |
|
|
|
* For example, a {@code List<String>} field value is assignable to a {@code Collection<CharSequence>} |
|
|
|
* field, but List<Number> is not assignable to List<Integer>. |
|
|
|
* field, but {@code List<Number>} is not assignable to {@code List<Integer>}. |
|
|
|
* @return {@code true} if this type is assignable to the type represented by the provided |
|
|
|
* @return {@code true} if this type is assignable to the type represented by the provided |
|
|
|
* type descriptor |
|
|
|
* type descriptor |
|
|
|
* @see #getObjectType() |
|
|
|
* @see #getObjectType() |
|
|
|
@ -576,7 +576,7 @@ public class TypeDescriptor implements Serializable { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Create a new type descriptor from a {@link java.util.Map} type. |
|
|
|
* Create a new type descriptor from a {@link java.util.Map} type. |
|
|
|
* <p>Useful for converting to typed Maps. |
|
|
|
* <p>Useful for converting to typed Maps. |
|
|
|
* <p>For example, a Map<String, String> could be converted to a Map<Id, EmailAddress> |
|
|
|
* <p>For example, a {@code Map<String, String>} could be converted to a {@code Map<Id, EmailAddress>} |
|
|
|
* by converting to a targetType built with this method: |
|
|
|
* by converting to a targetType built with this method: |
|
|
|
* The method call to construct such a TypeDescriptor would look something like: |
|
|
|
* The method call to construct such a TypeDescriptor would look something like: |
|
|
|
* <pre class="code"> |
|
|
|
* <pre class="code"> |
|
|
|
|