/** * Obtain the annotation of the specified {@code annotationType} that is on this type descriptor. * <p>As of Spring Framework 4.2, this method supports arbitrary levels of meta-annotations. * @param annotationType the annotation type * @return the annotation, or {@code null} if no such annotation exists on this type descriptor */ @Nullable public <T extends Annotation> T getAnnotation(Class<T> annotationType) { if (this.annotatedElement.isEmpty()) { // Shortcut: AnnotatedElementUtils would have to expect AnnotatedElement.getAnnotations() // to return a copy of the array, whereas we can do it more efficiently here. return null; } return AnnotatedElementUtils.getMergedAnnotation(this.annotatedElement, annotationType); }
/** * Obtain the annotation of the specified {@code annotationType} that is on this type descriptor. * <p>As of Spring Framework 4.2, this method supports arbitrary levels of meta-annotations. * @param annotationType the annotation type * @return the annotation, or {@code null} if no such annotation exists on this type descriptor */ @Nullable public <T extends Annotation> T getAnnotation(Class<T> annotationType) { if (this.annotatedElement.isEmpty()) { // Shortcut: AnnotatedElementUtils would have to expect AnnotatedElement.getAnnotations() // to return a copy of the array, whereas we can do it more efficiently here. return null; } return AnnotatedElementUtils.getMergedAnnotation(this.annotatedElement, annotationType); }
/** * Obtain the annotation of the specified {@code annotationType} that is on this type descriptor. * <p>As of Spring Framework 4.2, this method supports arbitrary levels of meta-annotations. * @param annotationType the annotation type * @return the annotation, or {@code null} if no such annotation exists on this type descriptor */ @Nullable public <T extends Annotation> T getAnnotation(Class<T> annotationType) { if (this.annotatedElement.isEmpty()) { // Shortcut: AnnotatedElementUtils would have to expect AnnotatedElement.getAnnotations() // to return a copy of the array, whereas we can do it more efficiently here. return null; } return AnnotatedElementUtils.getMergedAnnotation(this.annotatedElement, annotationType); }
/** * Determine if this type descriptor has the specified annotation. * <p>As of Spring Framework 4.2, this method supports arbitrary levels * of meta-annotations. * @param annotationType the annotation type * @return <tt>true</tt> if the annotation is present */ public boolean hasAnnotation(Class<? extends Annotation> annotationType) { if (this.annotatedElement.isEmpty()) { // Shortcut: AnnotatedElementUtils would have to expect AnnotatedElement.getAnnotations() // to return a copy of the array, whereas we can do it more efficiently here. return false; } return AnnotatedElementUtils.isAnnotated(this.annotatedElement, annotationType); }
/** * Obtain the annotation of the specified {@code annotationType} that is on this type descriptor. * <p>As of Spring Framework 4.2, this method supports arbitrary levels of meta-annotations. * @param annotationType the annotation type * @return the annotation, or {@code null} if no such annotation exists on this type descriptor */ @Nullable public <T extends Annotation> T getAnnotation(Class<T> annotationType) { if (this.annotatedElement.isEmpty()) { // Shortcut: AnnotatedElementUtils would have to expect AnnotatedElement.getAnnotations() // to return a copy of the array, whereas we can do it more efficiently here. return null; } return AnnotatedElementUtils.getMergedAnnotation(this.annotatedElement, annotationType); }
/** * Determine if this type descriptor has the specified annotation. * <p>As of Spring Framework 4.2, this method supports arbitrary levels * of meta-annotations. * @param annotationType the annotation type * @return <tt>true</tt> if the annotation is present */ public boolean hasAnnotation(Class<? extends Annotation> annotationType) { if (this.annotatedElement.isEmpty()) { // Shortcut: AnnotatedElementUtils would have to expect AnnotatedElement.getAnnotations() // to return a copy of the array, whereas we can do it more efficiently here. return false; } return AnnotatedElementUtils.isAnnotated(this.annotatedElement, annotationType); }
/** * Determine if this type descriptor has the specified annotation. * <p>As of Spring Framework 4.2, this method supports arbitrary levels * of meta-annotations. * @param annotationType the annotation type * @return <tt>true</tt> if the annotation is present */ public boolean hasAnnotation(Class<? extends Annotation> annotationType) { if (this.annotatedElement.isEmpty()) { // Shortcut: AnnotatedElementUtils would have to expect AnnotatedElement.getAnnotations() // to return a copy of the array, whereas we can do it more efficiently here. return false; } return AnnotatedElementUtils.isAnnotated(this.annotatedElement, annotationType); }
/** * Determine if this type descriptor has the specified annotation. * <p>As of Spring Framework 4.2, this method supports arbitrary levels * of meta-annotations. * @param annotationType the annotation type * @return <tt>true</tt> if the annotation is present */ public boolean hasAnnotation(Class<? extends Annotation> annotationType) { if (this.annotatedElement.isEmpty()) { // Shortcut: AnnotatedElementUtils would have to expect AnnotatedElement.getAnnotations() // to return a copy of the array, whereas we can do it more efficiently here. return false; } return AnnotatedElementUtils.isAnnotated(this.annotatedElement, annotationType); }