36
36
import org .springframework .util .ObjectUtils ;
37
37
38
38
/**
39
- * Context about a type to convert from or to.
39
+ * Contextual descriptor about a type to convert from or to.
40
+ * Capable of representing arrays and generic collection types.
40
41
*
41
42
* @author Keith Donald
42
43
* @author Andy Clement
45
46
* @author Sam Brannen
46
47
* @author Stephane Nicoll
47
48
* @since 3.0
49
+ * @see ConversionService#canConvert(TypeDescriptor, TypeDescriptor)
50
+ * @see ConversionService#convert(Object, TypeDescriptor, TypeDescriptor)
48
51
*/
49
52
@ SuppressWarnings ("serial" )
50
53
public class TypeDescriptor implements Serializable {
@@ -321,9 +324,9 @@ public boolean isArray() {
321
324
* If this type is a {@code Stream}, returns the stream's component type.
322
325
* If this type is a {@link Collection} and it is parameterized, returns the Collection's element type.
323
326
* If the Collection is not parameterized, returns {@code null} indicating the element type is not declared.
324
- * @return the array component type or Collection element type, or {@code null} if this type is a
325
- * Collection but its element type is not parameterized
326
- * @throws IllegalStateException if this type is not a {@code java.util.Collection} or array type
327
+ * @return the array component type or Collection element type, or {@code null} if this type is not
328
+ * an array type or a {@code java.util. Collection} or if its element type is not parameterized
329
+ * @see #elementTypeDescriptor(Object)
327
330
*/
328
331
@ Nullable
329
332
public TypeDescriptor getElementTypeDescriptor () {
@@ -350,8 +353,7 @@ public TypeDescriptor getElementTypeDescriptor() {
350
353
* TypeDescriptor that is returned.
351
354
* @param element the collection or array element
352
355
* @return a element type descriptor, narrowed to the type of the provided element
353
- * @throws IllegalStateException if this type is not a {@code java.util.Collection}
354
- * or array type
356
+ * @see #getElementTypeDescriptor()
355
357
* @see #narrow(Object)
356
358
*/
357
359
@ Nullable
0 commit comments