Example usage for org.springframework.core.type MethodMetadata getAllAnnotationAttributes

List of usage examples for org.springframework.core.type MethodMetadata getAllAnnotationAttributes

Introduction

In this page you can find the example usage for org.springframework.core.type MethodMetadata getAllAnnotationAttributes.

Prototype

@Nullable
default MultiValueMap<String, Object> getAllAnnotationAttributes(String annotationName) 

Source Link

Document

Retrieve all attributes of all annotations of the given type, if any (i.e.

Usage

From source file:minium.script.js.JsVariablePostProcessor.java

@Override
public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
    String[] beanDefinitionNames = registry.getBeanDefinitionNames();
    for (String beanDefinitionName : beanDefinitionNames) {
        BeanDefinition beanDefinition = registry.getBeanDefinition(beanDefinitionName);
        if (beanDefinition instanceof AnnotatedBeanDefinition) {
            MethodMetadata metadata = ((AnnotatedBeanDefinition) beanDefinition).getFactoryMethodMetadata();
            if (metadata == null)
                continue;
            MultiValueMap<String, Object> attrs = metadata
                    .getAllAnnotationAttributes(JsVariable.class.getName());
            if (attrs == null)
                continue;
            variables.put(beanDefinitionName, attrs);
        }//from  www  .  jav  a  2  s.  c  om
    }
}