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

com.github.datalking.context.annotation.MetadataUtils Maven / Gradle / Ivy

The newest version!
package com.github.datalking.context.annotation;

import com.github.datalking.common.meta.AnnotationAttributes;
import com.github.datalking.common.meta.AnnotationMetadata;
import com.github.datalking.common.meta.MethodMetadata;

/**
 * @author yaoo on 5/29/18
 */
public class MetadataUtils {

    public static AnnotationAttributes attributesFor(AnnotationMetadata metadata, Class annoClass) {
        return attributesFor(metadata, annoClass.getName());
    }

    public static AnnotationAttributes attributesFor(AnnotationMetadata metadata, String annoClassName) {
        return AnnotationAttributes.fromMap(metadata.getAnnotationAttributes(annoClassName, false));
    }

    public static AnnotationAttributes attributesFor(MethodMetadata metadata, Class targetAnno) {
        return AnnotationAttributes.fromMap(metadata.getAnnotationAttributes(targetAnno.getName()));
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy