All Downloads are FREE. Search and download functionalities are using the official Maven repository.

top.cutexingluo.tools.utils.spring.ImportSelectorUtil Maven / Gradle / Ivy

Go to download

xingtools 依赖core,附加,也就是基于 SpringBoot 的一些工具或实体类

The newest version!
package top.cutexingluo.tools.utils.spring;

import org.springframework.core.annotation.AnnotationAttributes;
import org.springframework.core.type.AnnotationMetadata;

import java.util.Map;

/**
 * @author XingTian
 * @version 1.0.0
 * @date 2024/7/16 12:25
 */
public class ImportSelectorUtil {

    /**
     * 获取 AnnotationAttributes 对象
     */
    public static AnnotationAttributes getAnnotationAttributes(AnnotationMetadata importingClassMetadata,Class annoType ){
        Map annotationAttributes = importingClassMetadata
                .getAnnotationAttributes(annoType.getName(), false);
        return annotationAttributes != null ?
                AnnotationAttributes.fromMap(annotationAttributes):null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy