List of usage examples for org.springframework.core.annotation AnnotatedElementUtils getMergedAnnotationAttributes
@Nullable public static AnnotationAttributes getMergedAnnotationAttributes(AnnotatedElement element, String annotationName)
From source file:org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.java
@Nullable private AnnotationAttributes findAutowiredAnnotation(AccessibleObject ao) { if (ao.getAnnotations().length > 0) { for (Class<? extends Annotation> type : this.autowiredAnnotationTypes) { AnnotationAttributes attributes = AnnotatedElementUtils.getMergedAnnotationAttributes(ao, type); if (attributes != null) { return attributes; }/*from w ww .ja v a2s . c om*/ } } return null; }
From source file:org.springframework.boot.actuate.endpoint.annotation.AnnotationEndpointDiscoverer.java
private Class<?> getEndpointType(Class<?> extensionType) { AnnotationAttributes attributes = AnnotatedElementUtils.getMergedAnnotationAttributes(extensionType, EndpointExtension.class); Class<?> endpointType = attributes.getClass("endpoint"); Assert.state(!endpointType.equals(Void.class), () -> "Extension " + endpointType.getName() + " does not specify an endpoint"); return endpointType; }
From source file:org.springframework.boot.actuate.endpoint.annotation.AnnotationEndpointDiscoverer.java
private boolean isEndpointExposed(Class<?> endpointType, EndpointInfo<T> endpointInfo) { if (isEndpointFiltered(endpointInfo)) { return false; }//from www. j a v a2 s. co m AnnotationAttributes annotationAttributes = AnnotatedElementUtils .getMergedAnnotationAttributes(endpointType, FilteredEndpoint.class); if (annotationAttributes == null) { return true; } Class<?> filterClass = annotationAttributes.getClass("value"); return isFilterMatch(filterClass, endpointInfo); }
From source file:org.springframework.boot.actuate.endpoint.annotation.AnnotationEndpointDiscoverer.java
/** * Determines if an extension is exposed. * @param endpointType the endpoint type * @param extensionType the extension type * @param endpointInfo the endpoint info * @return if the extension is exposed/*from w ww.ja va 2 s . c o m*/ */ protected boolean isExtensionExposed(Class<?> endpointType, Class<?> extensionType, EndpointInfo<T> endpointInfo) { AnnotationAttributes annotationAttributes = AnnotatedElementUtils .getMergedAnnotationAttributes(extensionType, EndpointExtension.class); Class<?> filterClass = annotationAttributes.getClass("filter"); return isFilterMatch(filterClass, endpointInfo); }