net.bytebuddy.matcher.DescriptorMatcher 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 lombok.EqualsAndHashCode;
import net.bytebuddy.description.ByteCodeElement;
/**
* An element matcher that matches a Java descriptor.
*
* @param The type of the matched entity.
*/
@EqualsAndHashCode(callSuper = false)
public class DescriptorMatcher extends ElementMatcher.Junction.AbstractBase {
/**
* A matcher to apply to the descriptor.
*/
private final ElementMatcher matcher;
/**
* Creates a new matcher for an element's descriptor.
*
* @param matcher A matcher to apply to the descriptor.
*/
public DescriptorMatcher(ElementMatcher matcher) {
this.matcher = matcher;
}
@Override
public boolean matches(T target) {
return matcher.matches(target.getDescriptor());
}
@Override
public String toString() {
return "hasDescriptor(" + matcher + ")";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy