Package | Description |
---|---|
net.bytebuddy.matcher |
Contains an API for matching Java byte code entities.
|
Modifier and Type | Class and Description |
---|---|
class |
AnnotationTypeMatcher<T extends AnnotationDescription>
An element matcher that matches the type of an annotation description.
|
class |
BooleanMatcher<T>
An element matcher that returns a fixed result.
|
class |
CollectionItemMatcher<T>
A list item matcher matches any element of a collection to a given matcher and assures that at least one
element matches the supplied iterable condition.
|
class |
CollectionOneToOneMatcher<T>
An element matcher that matches a given iterable collection to a list of matchers on a per-element basis.
|
class |
CollectionSizeMatcher<T extends Iterable<?>>
An element matcher that matches a collection by its size.
|
class |
DeclaringAnnotationMatcher<T extends AnnotatedCodeElement>
An element matcher that matches the list of annotations that are provided by an annotated element.
|
class |
DeclaringFieldMatcher<T extends TypeDescription>
An element matcher that checks if a type description declares fields of a given property.
|
class |
DeclaringMethodMatcher<T extends TypeDescription>
An element matcher that checks if a type description declares methods of a given property.
|
class |
DeclaringTypeMatcher<T extends DeclaredInType>
An element matcher that matches the declaring type of another element, only if this element is actually declared
in a type.
|
class |
DescriptorMatcher<T extends ByteCodeElement>
An element matcher that matches a Java descriptor.
|
static class |
ElementMatcher.Junction.AbstractBase<V>
A base implementation of
ElementMatcher.Junction . |
static class |
ElementMatcher.Junction.Conjunction<W>
A conjunction matcher which only matches an element if both represented matchers constitute a match.
|
static class |
ElementMatcher.Junction.Disjunction<W>
A disjunction matcher which only matches an element if both represented matchers constitute a match.
|
class |
EqualityMatcher<T>
An element matcher that checks an object's equality to another object.
|
class |
InheritedAnnotationMatcher<T extends TypeDescription>
An element matcher that matches the list of inherited annotations of a type description.
|
class |
MethodExceptionTypeMatcher<T extends MethodDescription>
An element matcher that matches the exceptions that are declared by a method.
|
class |
MethodParameterMatcher<T extends MethodDescription>
An element matcher that matches a method's parameters.
|
class |
MethodParameterTypeMatcher<T extends ParameterList>
An element matcher that matches a method's parameter types.
|
class |
MethodReturnTypeMatcher<T extends MethodDescription>
An element matcher that matches its argument's return type against a given type matcher.
|
class |
MethodSortMatcher<T extends MethodDescription>
Matches a method description by its general characteristics which are represented as a
MethodSortMatcher.Sort . |
class |
ModifierMatcher<T extends ModifierReviewable>
An element matcher that matches a byte code element by its modifiers.
|
class |
NameMatcher<T extends NamedElement>
A method matcher that matches a byte code element's source code name:
The source code name of types is equal to their binary name where arrays are appended a
[] by
their arity and where inner classes are appended by dots to their outer class's source name.
Constructors and the type initializer methods are represented by the empty string as they do not
represent a source code name.
Fields are named as in the source code.
|
class |
NegatingMatcher<T>
An element matcher that reverses the matching result of another matcher.
|
class |
NullMatcher<T>
An element matcher that matches the
null value. |
class |
StringMatcher
An element matcher that compares two strings by a given pattern which is characterized by a
StringMatcher.Mode . |
class |
SubTypeMatcher<T extends TypeDescription>
An element matcher that matches its argument for being another type's subtype.
|
class |
SuperTypeMatcher<T extends TypeDescription>
An element matcher that matches its argument for being another type's super type.
|
class |
VisibilityMatcher<T extends ByteCodeElement>
An element matcher that validates that a given byte code element is visible to a given type.
|
Modifier and Type | Method and Description |
---|---|
<U extends S> |
ElementMatcher.Junction.and(ElementMatcher<? super U> other)
Creates a conjunction where this matcher and the
other matcher must both be matched in order
to constitute a successful match. |
<U extends V> |
ElementMatcher.Junction.AbstractBase.and(ElementMatcher<? super U> other) |
static <T> ElementMatcher.Junction<T> |
ElementMatchers.any()
Creates a matcher that always returns
true . |
static <T extends AnnotationDescription> |
ElementMatchers.anyOf(Annotation... value)
Creates a matcher that matches any of the given annotations as
AnnotationDescription s
by the Object.equals(Object) method. |
static <T extends TypeDescription> |
ElementMatchers.anyOf(Class<?>... value)
Creates a matcher that matches any of the given types as
TypeDescription s
by the Object.equals(Object) method. |
static <T extends MethodDescription> |
ElementMatchers.anyOf(Constructor<?>... value)
Creates a matcher that matches any of the given constructors as
MethodDescription s
by the Object.equals(Object) method. |
static <T> ElementMatcher.Junction<T> |
ElementMatchers.anyOf(Iterable<?> values)
Creates a matcher that matches any of the given objects by the
Object.equals(Object) method. |
static <T extends MethodDescription> |
ElementMatchers.anyOf(Method... value)
Creates a matcher that matches any of the given methods as
MethodDescription s
by the Object.equals(Object) method. |
static <T> ElementMatcher.Junction<T> |
ElementMatchers.anyOf(Object... value)
Creates a matcher that matches any of the given objects by the
Object.equals(Object) method. |
static <T extends MethodDescription> |
ElementMatchers.canThrow(Class<? extends Throwable> exceptionType)
Matches a
MethodDescription by its capability to throw a given
checked exception. |
static <T extends MethodDescription> |
ElementMatchers.canThrow(TypeDescription exceptionType)
Matches a
MethodDescription by its capability to throw a given
checked exception. |
static <T extends AnnotatedCodeElement> |
ElementMatchers.declaresAnnotation(ElementMatcher<? super AnnotationDescription> matcher)
Matches an
AnnotatedCodeElement to declare any annotation
that matches the given matcher. |
static <T extends TypeDescription> |
ElementMatchers.declaresField(ElementMatcher<? super FieldDescription> fieldMatcher)
Matches a type by a another matcher that is applied on any of its declared fields.
|
static <T extends TypeDescription> |
ElementMatchers.declaresMethod(ElementMatcher<? super MethodDescription> methodMatcher)
Matches a type by a another matcher that is applied on any of its declared methods.
|
static <T extends TypeDescription> |
ElementMatchers.hasAnnotation(ElementMatcher<? super AnnotationDescription> matcher)
Matches a list of annotations by a given matcher on a type that declared these annotations or inherited them
from its super classes.
|
static <T extends ByteCodeElement> |
ElementMatchers.hasDescriptor(String descriptor)
Matches a
ByteCodeElement 's descriptor against a given value. |
static <T extends MethodDescription> |
ElementMatchers.hasParameter(ElementMatcher<? super ParameterDescription> matcher)
Matches a
MethodDescription by validating that at least one
parameter fullfils a given constraint. |
static <T extends MethodDescription> |
ElementMatchers.hasParameters(ElementMatcher<? super Iterable<? extends ParameterDescription>> matcher)
Matches a
MethodDescription by validating that its parameters
fulfill a given constraint. |
static <T extends TypeDescription> |
ElementMatchers.inheritsAnnotation(Class<?> type)
Matches any annotations by their type on a type that declared these annotations or inherited them from its
super classes.
|
static <T extends TypeDescription> |
ElementMatchers.inheritsAnnotation(ElementMatcher<? super TypeDescription> matcher)
Matches any annotations by a given matcher on a type that declared these annotations or inherited them from its
super classes.
|
static <T extends TypeDescription> |
ElementMatchers.inheritsAnnotation(TypeDescription typeDescription)
Matches any annotations by their type on a type that declared these annotations or inherited them from its
super classes.
|
static <T extends AnnotationDescription> |
ElementMatchers.is(Annotation annotation)
Exactly matches a given annotation as an
AnnotationDescription . |
static <T extends AnnotationDescription> |
ElementMatchers.is(AnnotationDescription annotationDescription)
Exactly matches a given
AnnotationDescription . |
static <T extends TypeDescription> |
ElementMatchers.is(Class<?> type)
Exactly matches a given type as a
TypeDescription . |
static <T extends MethodDescription> |
ElementMatchers.is(Constructor<?> constructor)
Exactly matches a given constructor as a
MethodDescription . |
static <T extends MethodDescription> |
ElementMatchers.is(Method method)
Exactly matches a given method as a
MethodDescription . |
static <T extends MethodDescription> |
ElementMatchers.is(MethodDescription methodDescription)
Exactly matches a given
MethodDescription . |
static <T> ElementMatcher.Junction<T> |
ElementMatchers.is(Object value)
Matches the given value which can also be
null by the Object.equals(Object) method or
by a null-check. |
static <T extends TypeDescription> |
ElementMatchers.is(TypeDescription typeDescription)
Exactly matches a given
TypeDescription . |
static <T extends AnnotatedCodeElement> |
ElementMatchers.isAnnotatedWith(Class<? extends Annotation> type)
Matches an
AnnotatedCodeElement for declared annotations. |
static <T extends AnnotatedCodeElement> |
ElementMatchers.isAnnotatedWith(ElementMatcher<? super TypeDescription> matcher)
Matches an
AnnotatedCodeElement for declared annotations. |
static <T extends AnnotatedCodeElement> |
ElementMatchers.isAnnotatedWith(TypeDescription typeDescription)
Matches an
AnnotatedCodeElement for declared annotations. |
static <T extends MethodDescription> |
ElementMatchers.isBridge()
Matches a
MethodDescription that is a bridge. |
static <T extends MethodDescription> |
ElementMatchers.isClone()
Only matches the
Object.clone() method, also if it was overridden. |
static <T extends MethodDescription> |
ElementMatchers.isConstructor()
Only matches method descriptions that represent a
Constructor . |
static <T extends ByteCodeElement> |
ElementMatchers.isDeclaredBy(Class<?> type)
Matches a
ByteCodeElement for being declared by a given
Class . |
static <T extends ByteCodeElement> |
ElementMatchers.isDeclaredBy(ElementMatcher<? super TypeDescription> matcher)
Matches a
ByteCodeElement for being declared by a
TypeDescription that is matched by the given matcher. |
static <T extends ByteCodeElement> |
ElementMatchers.isDeclaredBy(TypeDescription type)
Matches a
ByteCodeElement for being declared by a given
TypeDescription . |
static <T extends MethodDescription> |
ElementMatchers.isDefaultConstructor()
Matches a default constructor, i.e.
|
static <T extends MethodDescription> |
ElementMatchers.isDefaultFinalizer()
Only matches the
Object.finalize() method if it was not overridden. |
static <T extends MethodDescription> |
ElementMatchers.isDefaultMethod()
Only matches Java 8 default methods.
|
static <T extends MethodDescription> |
ElementMatchers.isEquals()
Only matches the
Object.equals(Object) method, also if it was overridden. |
static <T extends ModifierReviewable> |
ElementMatchers.isFinal()
Matches a
ModifierReviewable that is final . |
static <T extends MethodDescription> |
ElementMatchers.isFinalizer()
Only matches the
Object.finalize() method, even if it was overridden. |
static <T extends MethodDescription> |
ElementMatchers.isGetter()
Matches any Java bean getter method.
|
static <T extends MethodDescription> |
ElementMatchers.isGetter(Class<?> type)
Matches any Java bean getter method which returns the given type.
|
static <T extends MethodDescription> |
ElementMatchers.isGetter(ElementMatcher<? super TypeDescription> matcher)
Matches any Java bean getter method which returns an value with a type matches the supplied matcher.
|
static <T extends MethodDescription> |
ElementMatchers.isGetter(TypeDescription typeDescription)
Matches any Java bean getter method which returns the given type.
|
static <T extends MethodDescription> |
ElementMatchers.isHashCode()
Only matches the
Object.toString() method, also if it was overridden. |
static <T extends MethodDescription> |
ElementMatchers.isMethod()
Only matches method descriptions that represent a
Method . |
static <T extends MethodDescription> |
ElementMatchers.isNative()
Matches a
MethodDescription that is native . |
static <T extends MethodDescription> |
ElementMatchers.isOverridable()
Only matches methods that are overridable, i.e.
|
static <T extends ModifierReviewable> |
ElementMatchers.isPackagePrivate()
Matches a
ModifierReviewable that is package-private. |
static <T extends ModifierReviewable> |
ElementMatchers.isPrivate()
Matches a
ModifierReviewable that is private . |
static <T extends ModifierReviewable> |
ElementMatchers.isProtected()
Matches a
ModifierReviewable that is protected . |
static <T extends ModifierReviewable> |
ElementMatchers.isPublic()
Matches a
ModifierReviewable that is public . |
static <T extends MethodDescription> |
ElementMatchers.isSetter()
Matches any Java bean setter method.
|
static <T extends MethodDescription> |
ElementMatchers.isSetter(Class<?> type)
Matches any Java bean setter method which takes an argument the given type.
|
static <T extends MethodDescription> |
ElementMatchers.isSetter(ElementMatcher<? super TypeDescription> matcher)
Matches any Java bean setter method which takes an argument that matches the supplied matcher.
|
static <T extends MethodDescription> |
ElementMatchers.isSetter(TypeDescription typeDescription)
Matches any Java bean setter method which takes an argument the given type.
|
static <T extends MethodDescription> |
ElementMatchers.isSpecializationOf(MethodDescription methodDescription)
Matches a specialized version of a given method.
|
static <T extends ModifierReviewable> |
ElementMatchers.isStatic()
Matches a
ModifierReviewable that is static . |
static <T extends MethodDescription> |
ElementMatchers.isStrict()
Matches a
MethodDescription that is strictfp . |
static <T extends TypeDescription> |
ElementMatchers.isSubTypeOf(Class<?> type)
Matches any type description that is a subtype of the given type.
|
static <T extends TypeDescription> |
ElementMatchers.isSubTypeOf(TypeDescription typeDescription)
Matches any type description that is a subtype of the given type.
|
static <T extends TypeDescription> |
ElementMatchers.isSuperTypeOf(Class<?> type)
Matches any type description that is a super type of the given type.
|
static <T extends TypeDescription> |
ElementMatchers.isSuperTypeOf(TypeDescription typeDescription)
Matches any type description that is a super type of the given type.
|
static <T extends MethodDescription> |
ElementMatchers.isSynchronized()
Matches a
MethodDescription that is synchronized . |
static <T extends ModifierReviewable> |
ElementMatchers.isSynthetic()
Matches a
ModifierReviewable that is synthetic. |
static <T extends MethodDescription> |
ElementMatchers.isToString()
Only matches the
Object.toString() method, also if it was overridden. |
static <T extends MethodDescription> |
ElementMatchers.isTypeInitializer()
Only matches method descriptions that represent a
Class type initializer. |
static <T extends MethodDescription> |
ElementMatchers.isVarArgs()
Matches a
MethodDescription that is a var-args. |
static <T extends MethodDescription> |
ElementMatchers.isVisibilityBridge()
Only matches method descriptions that represent a visibility bridge.
|
static <T extends ByteCodeElement> |
ElementMatchers.isVisibleTo(Class<?> type)
Matches a
ByteCodeElement that is visible to a given Class . |
static <T extends ByteCodeElement> |
ElementMatchers.isVisibleTo(TypeDescription typeDescription)
Matches a
ByteCodeElement that is visible to a given
TypeDescription . |
static <T extends NamedElement> |
ElementMatchers.nameContains(String infix)
Matches a
NamedElement for an infix of its name. |
static <T extends NamedElement> |
ElementMatchers.nameContainsIgnoreCase(String infix)
Matches a
NamedElement for an infix of its name. |
static <T extends NamedElement> |
ElementMatchers.named(String name)
Matches a
NamedElement for its exact name. |
static <T extends NamedElement> |
ElementMatchers.namedIgnoreCase(String name)
Matches a
NamedElement for its name. |
static <T extends NamedElement> |
ElementMatchers.nameEndsWith(String suffix)
Matches a
NamedElement for its name's suffix. |
static <T extends NamedElement> |
ElementMatchers.nameEndsWithIgnoreCase(String suffix)
Matches a
NamedElement for its name's suffix. |
static <T extends NamedElement> |
ElementMatchers.nameMatches(String regex)
Matches a
NamedElement name against a regular expression. |
static <T extends NamedElement> |
ElementMatchers.nameStartsWith(String prefix)
Matches a
NamedElement for its name's prefix. |
static <T extends NamedElement> |
ElementMatchers.nameStartsWithIgnoreCase(String prefix)
Matches a
NamedElement for its name's prefix. |
static <T> ElementMatcher.Junction<T> |
ElementMatchers.none()
Creates a matcher that always returns
false . |
static <T extends AnnotationDescription> |
ElementMatchers.noneOf(Annotation... value)
Creates a matcher that matches none of the given annotations as
AnnotationDescription s
by the Object.equals(Object) method. |
static <T extends TypeDescription> |
ElementMatchers.noneOf(Class<?>... value)
Creates a matcher that matches none of the given types as
TypeDescription s
by the Object.equals(Object) method. |
static <T extends MethodDescription> |
ElementMatchers.noneOf(Constructor<?>... value)
Creates a matcher that matches none of the given constructors as
MethodDescription s
by the Object.equals(Object) method. |
static <T> ElementMatcher.Junction<T> |
ElementMatchers.noneOf(Iterable<?> values)
Creates a matcher that matches none of the given objects by the
Object.equals(Object) method. |
static <T extends MethodDescription> |
ElementMatchers.noneOf(Method... value)
Creates a matcher that matches none of the given methods as
MethodDescription s
by the Object.equals(Object) method. |
static <T> ElementMatcher.Junction<T> |
ElementMatchers.noneOf(Object... value)
Creates a matcher that matches none of the given objects by the
Object.equals(Object) method. |
static <T> ElementMatcher.Junction<T> |
ElementMatchers.not(ElementMatcher<? super T> matcher)
Inverts another matcher.
|
<U extends S> |
ElementMatcher.Junction.or(ElementMatcher<? super U> other)
Creates a disjunction where either this matcher or the
other matcher must be matched in order
to constitute a successful match. |
<U extends V> |
ElementMatcher.Junction.AbstractBase.or(ElementMatcher<? super U> other) |
static <T extends MethodDescription> |
ElementMatchers.returns(Class<?> type)
Matches
MethodDescription s that returns a given
Class . |
static <T extends MethodDescription> |
ElementMatchers.returns(ElementMatcher<? super TypeDescription> matcher)
Matches
MethodDescription s that matches a matched method's
return type. |
static <T extends MethodDescription> |
ElementMatchers.returns(TypeDescription typeDescription)
Matches
MethodDescription s that returns a given
TypeDescription . |
static <T extends MethodDescription> |
ElementMatchers.takesArguments(Class<?>... type)
Matches a
MethodDescription by its exact parameter types. |
static <T extends MethodDescription> |
ElementMatchers.takesArguments(ElementMatcher<? super Iterable<? extends TypeDescription>> matchers)
Matches a
MethodDescription by applying an iterable collection
of element matcher on any parameter's TypeDescription . |
static <T extends MethodDescription> |
ElementMatchers.takesArguments(int length)
Matches a
MethodDescription by the number of its parameters. |
static <T extends MethodDescription> |
ElementMatchers.takesArguments(Iterable<? extends TypeDescription> typeDescriptions)
Matches a
MethodDescription by its exact parameter types. |
static <T extends MethodDescription> |
ElementMatchers.takesArguments(TypeDescription... typeDescription)
Matches a
MethodDescription by its exact parameter types. |
static <T extends MethodDescription> |
ElementMatchers.throwing(ElementMatcher<? super List<? extends TypeDescription>> exceptionMatcher)
Matches a
MethodDescription by its declared exceptions. |
Copyright © 2014–2015. All rights reserved.