|
21 | 21 | import java.lang.reflect.Proxy; |
22 | 22 | import java.lang.reflect.Type; |
23 | 23 | import java.lang.reflect.WildcardType; |
| 24 | +import java.net.URL; |
24 | 25 | import java.time.LocalDate; |
25 | 26 | import java.time.LocalDateTime; |
26 | 27 | import java.time.LocalTime; |
@@ -307,6 +308,7 @@ public Entry<String, Object> next() { |
307 | 308 | * <li>{@link LocalDate}</li> |
308 | 309 | * <li>{@link LocalTime}</li> |
309 | 310 | * <li>{@link LocalDateTime}</li> |
| 311 | + * <li>{@link URL}</li> |
310 | 312 | * </ul> |
311 | 313 | * |
312 | 314 | * If the value is an instance of {@link Iterable}, it is wrapped in an |
@@ -338,7 +340,8 @@ private static Object adapt(Object value, HashMap<Class<?>, HashMap<String, Meth |
338 | 340 | || value instanceof Date |
339 | 341 | || value instanceof LocalDate |
340 | 342 | || value instanceof LocalTime |
341 | | - || value instanceof LocalDateTime) { |
| 343 | + || value instanceof LocalDateTime |
| 344 | + || value instanceof URL) { |
342 | 345 | return value; |
343 | 346 | } else if (value instanceof Iterable<?>) { |
344 | 347 | return new IterableAdapter((Iterable<?>)value, accessorCache); |
@@ -397,13 +400,14 @@ public static <V> V valueAt(Map<String, ?> root, String path) { |
397 | 400 | * <li>{@link Long} or <tt>long</tt>: "long"</li> |
398 | 401 | * <li>{@link Float} or <tt>float</tt>: "float"</li> |
399 | 402 | * <li>{@link Double} or <tt>double</tt>: "double"</li> |
400 | | - * <li>Any other type that extends {@link Number}: "number"</li> |
401 | | - * <li>Any type that implements {@link CharSequence}: "string"</li> |
402 | | - * <li>Any {@link Enum} type: "enum"</li> |
403 | | - * <li>Any type that extends {@link Date}: "date"</li> |
| 403 | + * <li>Any other {@link Number}: "number"</li> |
| 404 | + * <li>{@link CharSequence}: "string"</li> |
| 405 | + * <li>{@link Enum}: "enum"</li> |
| 406 | + * <li>{@link Date}: "date"</li> |
404 | 407 | * <li>{@link LocalDate}: "date-local"</li> |
405 | 408 | * <li>{@link LocalTime}: "time-local"</li> |
406 | 409 | * <li>{@link LocalDateTime}: "datetime-local"</li> |
| 410 | + * <li>{@link URL}: "url"</li> |
407 | 411 | * <li>{@link Iterable}, {@link Collection}, or {@link List}: "[<i>element type</i>]"</li> |
408 | 412 | * <li>{@link Map}: "[<i>key type</i>: <i>value type</i>]"</li> |
409 | 413 | * <li>Any other type: "{property1: <i>property 1 type</i>, property2: <i>property 2 type</i>, ...}"</li> |
@@ -477,6 +481,8 @@ private static String describe(Class<?> type, Map<Class<?>, String> structures) |
477 | 481 | return "time-local"; |
478 | 482 | } else if (type == LocalDateTime.class) { |
479 | 483 | return "datetime-local"; |
| 484 | + } else if (type == URL.class) { |
| 485 | + return "url"; |
480 | 486 | } else { |
481 | 487 | if (!structures.containsKey(type)) { |
482 | 488 | structures.put(type, null); |
|
0 commit comments