Search in sources :

Example 1 with MergedAnnotations

use of cn.taketoday.core.annotation.MergedAnnotations in project today-infrastructure by TAKETODAY.

the class AnnotationDependencyResolvingStrategy method supportsInternal.

private boolean supportsInternal(AccessibleObject accessible) {
    MergedAnnotations annotations = MergedAnnotations.from(accessible);
    Class<? extends Annotation>[] supportedAnnotations = getSupportedAnnotations();
    for (Class<? extends Annotation> supportedAnnotation : supportedAnnotations) {
        if (annotations.isPresent(supportedAnnotation)) {
            return true;
        }
    }
    return false;
}
Also used : MergedAnnotations(cn.taketoday.core.annotation.MergedAnnotations) Annotation(java.lang.annotation.Annotation)

Example 2 with MergedAnnotations

use of cn.taketoday.core.annotation.MergedAnnotations in project today-infrastructure by TAKETODAY.

the class DefinitionsParser method parseElement.

private void parseElement(AnnotatedElement element, Class<?> source) {
    MergedAnnotations annotations = MergedAnnotations.from(element, SearchStrategy.SUPERCLASS);
    annotations.stream(MockBean.class).map(MergedAnnotation::synthesize).forEach((annotation) -> parseMockBeanAnnotation(annotation, element, source));
    annotations.stream(SpyBean.class).map(MergedAnnotation::synthesize).forEach((annotation) -> parseSpyBeanAnnotation(annotation, element, source));
}
Also used : MergedAnnotations(cn.taketoday.core.annotation.MergedAnnotations)

Example 3 with MergedAnnotations

use of cn.taketoday.core.annotation.MergedAnnotations in project today-framework by TAKETODAY.

the class AnnotationDependencyResolvingStrategy method supportsInternal.

private boolean supportsInternal(AccessibleObject accessible) {
    MergedAnnotations annotations = MergedAnnotations.from(accessible);
    Class<? extends Annotation>[] supportedAnnotations = getSupportedAnnotations();
    for (Class<? extends Annotation> supportedAnnotation : supportedAnnotations) {
        if (annotations.isPresent(supportedAnnotation)) {
            return true;
        }
    }
    return false;
}
Also used : MergedAnnotations(cn.taketoday.core.annotation.MergedAnnotations) Annotation(java.lang.annotation.Annotation)

Example 4 with MergedAnnotations

use of cn.taketoday.core.annotation.MergedAnnotations in project today-framework by TAKETODAY.

the class SimpleMethodMetadataReadingVisitor method visitEnd.

@Override
public void visitEnd() {
    MergedAnnotations annotations = MergedAnnotations.valueOf(this.annotations);
    SimpleMethodMetadata metadata = new SimpleMethodMetadata(access, declaringClassName, getSource(), annotations, methodSignature, classLoader);
    consumer.accept(metadata);
}
Also used : MergedAnnotations(cn.taketoday.core.annotation.MergedAnnotations)

Example 5 with MergedAnnotations

use of cn.taketoday.core.annotation.MergedAnnotations in project today-framework by TAKETODAY.

the class DefinitionsParser method parseElement.

private void parseElement(AnnotatedElement element, Class<?> source) {
    MergedAnnotations annotations = MergedAnnotations.from(element, SearchStrategy.SUPERCLASS);
    annotations.stream(MockBean.class).map(MergedAnnotation::synthesize).forEach((annotation) -> parseMockBeanAnnotation(annotation, element, source));
    annotations.stream(SpyBean.class).map(MergedAnnotation::synthesize).forEach((annotation) -> parseSpyBeanAnnotation(annotation, element, source));
}
Also used : MergedAnnotations(cn.taketoday.core.annotation.MergedAnnotations)

Aggregations

MergedAnnotations (cn.taketoday.core.annotation.MergedAnnotations)8 Annotation (java.lang.annotation.Annotation)2 URLClassLoader (java.net.URLClassLoader)2