File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
src/main/java/org/hibernate/models/spi Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -133,9 +133,30 @@ default <X extends Annotation> void forEachAnnotationUsage(
133
133
<X extends Annotation > void forEachAnnotationUsage (Class <X > type , Consumer <AnnotationUsage <X >> consumer );
134
134
135
135
/**
136
- * Returns all annotations on this target where the annotation class is annotated with `metaAnnotationType`.
136
+ * Returns all AnnotationUsage references from this target where the usage's
137
+ * {@linkplain AnnotationUsage#getAnnotationDescriptor() annotation class} is annotated
138
+ * with the given {@code metaAnnotationType}.
139
+ * <p/>
140
+ * E.g., given the following class and annotations
141
+ * <pre class="brush:java">
142
+ * {@code @interface TheMeta} {
143
+ * ...
144
+ * }
145
+ *
146
+ * {@code @TheMeta(...)}
147
+ * {@code @interface TheAnnotation} {
148
+ * ...
149
+ * }
150
+ *
151
+ * {@code @TheAnnotation}
152
+ * {@code class TheClass} {
153
+ * ...
154
+ * }
155
+ * </pre>
156
+ * a call to this method passing {@code TheMeta} on {@code ClassDetails(TheClass)} will return
157
+ * the usage of {@code @TheAnnotation} on {@code TheClass}.
137
158
*/
138
- default List <AnnotationUsage <?>> getMetaAnnotated (Class <? extends Annotation > metaAnnotationType ) {
159
+ default < A extends Annotation > List <AnnotationUsage <? extends Annotation >> getMetaAnnotated (Class <A > metaAnnotationType ) {
139
160
final List <AnnotationUsage <?>> usages = new ArrayList <>();
140
161
forAllAnnotationUsages ( (usage ) -> {
141
162
final AnnotationUsage <? extends Annotation > metaUsage = usage .getAnnotationDescriptor ().getAnnotationUsage ( metaAnnotationType );
You can’t perform that action at this time.
0 commit comments