net.bytebuddy.matcher.DeclaringAnnotationMatcher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of byte-buddy Show documentation
Show all versions of byte-buddy Show documentation
Byte Buddy is a Java library for creating Java classes at run time.
This artifact is a build of Byte Buddy with all ASM dependencies repackaged into its own name space.
package net.bytebuddy.matcher;
import net.bytebuddy.build.HashCodeAndEqualsPlugin;
import net.bytebuddy.description.annotation.AnnotationList;
import net.bytebuddy.description.annotation.AnnotationSource;
/**
* An element matcher that matches the list of annotations that are provided by an annotated element.
*
* @param The actual matched type of this matcher.
*/
@HashCodeAndEqualsPlugin.Enhance
public class DeclaringAnnotationMatcher extends ElementMatcher.Junction.AbstractBase {
/**
* The matcher to be applied to the provided annotation list.
*/
private final ElementMatcher super AnnotationList> matcher;
/**
* Creates a new matcher for the annotations of an annotated element.
*
* @param matcher The matcher to be applied to the provided annotation list.
*/
public DeclaringAnnotationMatcher(ElementMatcher super AnnotationList> matcher) {
this.matcher = matcher;
}
@Override
public boolean matches(T target) {
return matcher.matches(target.getDeclaredAnnotations());
}
@Override
public String toString() {
return "declaresAnnotations(" + matcher + ")";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy