|
1 | 1 | /* |
2 | | - * Copyright 2002-2013 the original author or authors. |
| 2 | + * Copyright 2002-2014 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -109,7 +109,15 @@ public TypeDescriptor(Property property) { |
109 | 109 | this.annotations = nullSafeAnnotations(property.getAnnotations()); |
110 | 110 | } |
111 | 111 |
|
112 | | - private TypeDescriptor(ResolvableType resolvableType, Class<?> type, Annotation[] annotations) { |
| 112 | + /** |
| 113 | + * Create a new type descriptor from a {@link ResolvableType}. This protected |
| 114 | + * constructor is used internally and may also be used by subclasses that support |
| 115 | + * non-Java languages with extended type systems. |
| 116 | + * @param resolvableType the resolvable type |
| 117 | + * @param type the backing type or {@code null} if should be resolved |
| 118 | + * @param annotations the type annotations |
| 119 | + */ |
| 120 | + protected TypeDescriptor(ResolvableType resolvableType, Class<?> type, Annotation[] annotations) { |
113 | 121 | this.resolvableType = resolvableType; |
114 | 122 | this.type = (type != null ? type : resolvableType.resolve(Object.class)); |
115 | 123 | this.annotations = nullSafeAnnotations(annotations); |
@@ -141,6 +149,13 @@ public Class<?> getType() { |
141 | 149 | return this.type; |
142 | 150 | } |
143 | 151 |
|
| 152 | + /** |
| 153 | + * Returns the underlying {@link ResolvableType}. |
| 154 | + */ |
| 155 | + protected ResolvableType getResolvableType() { |
| 156 | + return this.resolvableType; |
| 157 | + } |
| 158 | + |
144 | 159 | /** |
145 | 160 | * Return the underlying source of the descriptor. Will return a {@link Field}, |
146 | 161 | * {@link MethodParameter} or {@link Type} depending on how the {@link TypeDescriptor} |
|
0 commit comments