Skip to content

Commit

Permalink
Merge pull request #401 from Ladicek/improve-annotation-overlay-docs
Browse files Browse the repository at this point in the history
improve javadoc of AnnotationOverlay.annotation()
  • Loading branch information
Ladicek authored Jun 13, 2024
2 parents 8e484e3 + 95a8ca1 commit 0e74811
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions core/src/main/java/org/jboss/jandex/AnnotationOverlay.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,11 @@ default boolean hasAnyAnnotation(Declaration declaration, Class<? extends Annota
/**
* Returns the annotation instance with given {@code name} declared on given {@code declaration}.
* <p>
* Like {@link AnnotationTarget#annotation(DotName)}, and unlike {@link AnnotationTarget#annotation(DotName)},
* Like {@link AnnotationTarget#declaredAnnotation(DotName)}, and unlike {@link AnnotationTarget#annotation(DotName)},
* this method doesn't return annotations declared on nested annotation targets. This doesn't hold in case of methods
* in the {@linkplain Builder#compatibleMode() compatible mode}, where method parameters are considered
* part of methods.
* part of methods. In such case, if more than one annotation of given {@code name} is present, an unspecified
* instance is returned.
*
* @param declaration the declaration to inspect, must not be {@code null}
* @param name name of the annotation type to look for, must not be {@code null}
Expand All @@ -126,10 +127,11 @@ default boolean hasAnyAnnotation(Declaration declaration, Class<? extends Annota
/**
* Returns the annotation instance of given {@code clazz} declared on given {@code declaration}.
* <p>
* Like {@link AnnotationTarget#annotation(Class)}, and unlike {@link AnnotationTarget#annotation(Class)},
* Like {@link AnnotationTarget#declaredAnnotation(Class)}, and unlike {@link AnnotationTarget#annotation(Class)},
* this method doesn't return annotations declared on nested annotation targets. This doesn't hold in case of methods
* in the {@linkplain Builder#compatibleMode() compatible mode}, where method parameters are considered
* part of methods.
* part of methods. In such case, if more than one annotation of given {@code clazz} is present, an unspecified
* instance is returned.
*
* @param declaration the declaration to inspect, must not be {@code null}
* @param clazz the annotation type to look for, must not be {@code null}
Expand Down

0 comments on commit 0e74811

Please sign in to comment.