public final class ElementMatchers extends Object
ElementMatcher
s.Modifier and Type | Method and Description |
---|---|
static <T> ElementMatcher.Junction<T> |
any()
Creates a matcher that always returns
true . |
static <T extends AnnotationDescription> |
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 MethodDescription> |
anyOf(Constructor<?>... value)
Creates a matcher that matches any of the given constructors as
MethodDescription s
by the Object.equals(Object) method. |
static <T extends FieldDescription> |
anyOf(Field... value)
Creates a matcher that matches any of the given fields as
FieldDescription s
by the Object.equals(Object) method. |
static <T> ElementMatcher.Junction<T> |
anyOf(Iterable<?> values)
Creates a matcher that matches any of the given objects by the
Object.equals(Object) method. |
static <T extends MethodDescription> |
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> |
anyOf(Object... value)
Creates a matcher that matches any of the given objects by the
Object.equals(Object) method. |
static <T extends TypeDefinition> |
anyOf(Type... value)
Creates a matcher that matches any of the given types as
TypeDescription s
by the Object.equals(Object) method. |
static <T extends MethodDescription> |
canThrow(Class<? extends Throwable> exceptionType)
Matches a
MethodDescription by its capability to throw a given
checked exception. |
static <T extends MethodDescription> |
canThrow(TypeDescription exceptionType)
Matches a
MethodDescription by its capability to throw a given
checked exception. |
static <T extends AnnotatedCodeElement> |
declaresAnnotation(ElementMatcher<? super AnnotationDescription> matcher)
Matches an
AnnotatedCodeElement to declare any annotation
that matches the given matcher. |
static <T extends MethodDescription> |
declaresException(Class<? extends Throwable> exceptionType)
Matches a method that declares the given generic exception type as a (erased) exception type.
|
static <T extends MethodDescription> |
declaresException(TypeDescription exceptionType)
Matches a method that declares the given generic exception type as a (erased) exception type.
|
static <T extends TypeDefinition> |
declaresField(ElementMatcher<? super FieldDescription> fieldMatcher)
Matches a type by a another matcher that is applied on any of its declared fields.
|
static <T extends MethodDescription> |
declaresGenericException(ElementMatcher<? super Iterable<? extends TypeDescription.Generic>> exceptionMatcher)
Matches a method's generic exception types against the provided matcher.
|
static <T extends MethodDescription> |
declaresGenericException(Type exceptionType)
Matches a method that declares the given generic exception type.
|
static <T extends MethodDescription> |
declaresGenericException(TypeDescription.Generic exceptionType)
Matches a method that declares the given generic exception type.
|
static <T extends TypeDefinition> |
declaresMethod(ElementMatcher<? super MethodDescription> methodMatcher)
Matches a type by a another matcher that is applied on any of its declared methods.
|
static <T extends FieldDescription> |
definedField(ElementMatcher<? super FieldDescription.InDefinedShape> matcher)
Matches a field in its defined shape.
|
static <T extends MethodDescription> |
definedMethod(ElementMatcher<? super MethodDescription.InDefinedShape> matcher)
Matches a method in its defined shape.
|
static <T extends ParameterDescription> |
definedParameter(ElementMatcher<? super ParameterDescription.InDefinedShape> matcher)
Matches a parameter in its defined shape.
|
static <T> ElementMatcher.Junction<T> |
failSafe(ElementMatcher<? super T> matcher)
Wraps another matcher to assure that an element is not matched in case that the matching causes an
Exception . |
static <T extends FieldDescription> |
fieldType(Class<?> fieldType)
Matches a field's raw type against the provided matcher.
|
static <T extends FieldDescription> |
fieldType(ElementMatcher<? super TypeDescription> matcher)
Matches a field's raw type against the provided matcher.
|
static <T extends FieldDescription> |
fieldType(TypeDescription fieldType)
Matches a field's raw type against the provided matcher.
|
static <T extends FieldDescription> |
genericFieldType(ElementMatcher<? super TypeDescription.Generic> matcher)
Matches a field's generic type against the provided matcher.
|
static <T extends FieldDescription> |
genericFieldType(Type fieldType)
Matches a field's generic type against the provided matcher.
|
static <T extends FieldDescription> |
genericFieldType(TypeDescription.Generic fieldType)
Matches a field's generic type against the provided matcher.
|
static <T extends TypeDescription> |
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 ClassLoader> |
hasChild(ElementMatcher<? super ClassLoader> matcher)
Matches all class loaders in the hierarchy of the matched class loader against a given matcher.
|
static <T extends ByteCodeElement> |
hasDescriptor(String descriptor)
Matches a
ByteCodeElement 's descriptor against a given value. |
static <T extends ParameterDescription> |
hasGenericType(ElementMatcher<? super TypeDescription.Generic> matcher)
Matches a method parameter by its generic type.
|
static <T extends MethodDescription> |
hasMethodName(String internalName)
Matches a method against its internal name such that constructors and type initializers are matched appropriately.
|
static <T extends MethodDescription> |
hasParameters(ElementMatcher<? super Iterable<? extends ParameterDescription>> matcher)
Matches a
MethodDescription by validating that its parameters
fulfill a given constraint. |
static <T extends ParameterDescription> |
hasType(ElementMatcher<? super TypeDescription> matcher)
Matches a parameter's type by the given matcher.
|
static <T extends TypeDescription> |
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> |
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> |
inheritsAnnotation(TypeDescription type)
Matches any annotations by their type on a type that declared these annotations or inherited them from its
super classes.
|
static <T extends AnnotationDescription> |
is(Annotation annotation)
Exactly matches a given annotation as an
AnnotationDescription . |
static <T extends MethodDescription> |
is(Constructor<?> constructor)
Exactly matches a given constructor as a
MethodDescription . |
static <T extends FieldDescription> |
is(Field field)
Exactly matches a given field as a
FieldDescription . |
static <T extends MethodDescription> |
is(Method method)
Exactly matches a given method as a
MethodDescription . |
static <T> ElementMatcher.Junction<T> |
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 TypeDefinition> |
is(Type type)
Exactly matches a given type as a
TypeDescription . |
static <T extends ModifierReviewable> |
isAbstract()
Matches a
ModifierReviewable that is abstract . |
static <T extends AnnotatedCodeElement> |
isAnnotatedWith(Class<? extends Annotation> type)
Matches an
AnnotatedCodeElement for declared annotations. |
static <T extends AnnotatedCodeElement> |
isAnnotatedWith(ElementMatcher<? super TypeDescription> matcher)
Matches an
AnnotatedCodeElement for declared annotations. |
static <T extends AnnotatedCodeElement> |
isAnnotatedWith(TypeDescription type)
Matches an
AnnotatedCodeElement for declared annotations. |
static <T extends ClassLoader> |
isBootstrapClassLoader()
Matches exactly the bootstrap
ClassLoader . |
static <T extends MethodDescription> |
isBridge()
Matches a
MethodDescription that is a bridge. |
static <T extends ClassLoader> |
isChildOf(ClassLoader classLoader)
Matches any class loader that is either the given class loader or a child of the given class loader.
|
static <T extends MethodDescription> |
isClone()
Only matches the
Object.clone() method, also if it was overridden. |
static <T extends MethodDescription> |
isConstructor()
Only matches method descriptions that represent a
Constructor . |
static <T extends ByteCodeElement> |
isDeclaredBy(Class<?> type)
Matches a
ByteCodeElement for being declared by a given Class . |
static <T extends ByteCodeElement> |
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> |
isDeclaredBy(TypeDescription type)
Matches a
ByteCodeElement for being declared by a given TypeDescription . |
static <T extends ByteCodeElement> |
isDeclaredByGeneric(ElementMatcher<? super TypeDescription.Generic> matcher)
Matches a
ByteCodeElement for being declared by a TypeDescription.Generic that is matched by the given matcher. |
static <T extends ByteCodeElement> |
isDeclaredByGeneric(Type type)
Matches a
ByteCodeElement for being declared by a given generic Type . |
static <T extends ByteCodeElement> |
isDeclaredByGeneric(TypeDescription.Generic type)
Matches a
ByteCodeElement for being declared by a given TypeDescription.Generic . |
static <T extends MethodDescription> |
isDefaultConstructor()
Matches a default constructor, i.e. a constructor without arguments.
|
static <T extends MethodDescription> |
isDefaultFinalizer()
Only matches the
Object.finalize() method if it was not overridden. |
static <T extends MethodDescription> |
isDefaultMethod()
Only matches Java 8 default methods.
|
static <T extends MethodDescription> |
isEquals()
Only matches the
Object.equals(Object) method, also if it was overridden. |
static <T extends ClassLoader> |
isExtensionClassLoader()
Matches exactly the extension
ClassLoader . |
static <T extends ModifierReviewable> |
isFinal()
Matches a
ModifierReviewable that is final . |
static <T extends MethodDescription> |
isFinalizer()
Only matches the
Object.finalize() method, even if it was overridden. |
static <T extends MethodDescription> |
isGetter()
Matches any Java bean getter method.
|
static <T extends MethodDescription> |
isGetter(ElementMatcher<? super TypeDescription.Generic> matcher)
Matches any Java bean getter method which returns an value with a type matches the supplied matcher.
|
static <T extends MethodDescription> |
isGetter(Type type)
Matches any Java bean getter method which returns the given type.
|
static <T extends MethodDescription> |
isGetter(TypeDescription.Generic type)
Matches any Java bean getter method which returns the given type.
|
static <T extends MethodDescription> |
isHashCode()
Only matches the
Object.toString() method, also if it was overridden. |
static <T extends TypeDescription> |
isInterface()
Matches a
TypeDescription that is an interface. |
static <T extends MethodDescription> |
isMethod()
Only matches method descriptions that represent a
Method . |
static <T extends MethodDescription> |
isNative()
Matches a
MethodDescription that is native . |
static <T extends ModifierReviewable> |
isPackagePrivate()
Matches a
ModifierReviewable that is package-private. |
static <T extends ClassLoader> |
isParentOf(ClassLoader classLoader)
Matches any class loader that is either the given class loader or a parent of the given class loader.
|
static <T extends ModifierReviewable> |
isPrivate()
Matches a
ModifierReviewable that is private . |
static <T extends ModifierReviewable> |
isProtected()
Matches a
ModifierReviewable that is protected . |
static <T extends ModifierReviewable> |
isPublic()
Matches a
ModifierReviewable that is public . |
static <T extends MethodDescription> |
isSetter()
Matches any Java bean setter method.
|
static <T extends MethodDescription> |
isSetter(ElementMatcher<? super TypeDescription.Generic> matcher)
Matches any Java bean setter method which takes an argument that matches the supplied matcher.
|
static <T extends MethodDescription> |
isSetter(Type type)
Matches any Java bean setter method which takes an argument the given type.
|
static <T extends MethodDescription> |
isSetter(TypeDescription.Generic type)
Matches any Java bean setter method which takes an argument the given type.
|
static <T extends ModifierReviewable> |
isStatic()
Matches a
ModifierReviewable that is static . |
static <T extends MethodDescription> |
isStrict()
Matches a
MethodDescription that is strictfp . |
static <T extends TypeDescription> |
isSubTypeOf(Class<?> type)
Matches any type description that is a subtype of the given type.
|
static <T extends TypeDescription> |
isSubTypeOf(TypeDescription type)
Matches any type description that is a subtype of the given type.
|
static <T extends TypeDescription> |
isSuperTypeOf(Class<?> type)
Matches any type description that is a super type of the given type.
|
static <T extends TypeDescription> |
isSuperTypeOf(TypeDescription type)
Matches any type description that is a super type of the given type.
|
static <T extends MethodDescription> |
isSynchronized()
Matches a
MethodDescription that is synchronized . |
static <T extends ModifierReviewable> |
isSynthetic()
Matches a
ModifierReviewable that is synthetic. |
static <T extends ClassLoader> |
isSystemClassLoader()
Matches exactly the system
ClassLoader . |
static <T extends MethodDescription> |
isToString()
Only matches the
Object.toString() method, also if it was overridden. |
static <T extends MethodDescription> |
isTypeInitializer()
Only matches method descriptions that represent a
Class type initializer. |
static <T extends MethodDescription> |
isVarArgs()
Matches a
MethodDescription that is a var-args. |
static <T extends TypeDefinition> |
isVariable(ElementMatcher<? super NamedElement> matcher)
Matches a type variable with the given name.
|
static <T extends TypeDefinition> |
isVariable(String symbol)
Matches a type variable with the given name.
|
static <T extends MethodDescription> |
isVirtual()
Matches any method that is virtual, i.e. non-constructors that are non-static and non-private.
|
static <T extends ByteCodeElement> |
isVisibleTo(Class<?> type)
Matches a
ByteCodeElement that is visible to a given Class . |
static <T extends ByteCodeElement> |
isVisibleTo(TypeDescription type)
Matches a
ByteCodeElement that is visible to a given
TypeDescription . |
static <T extends NamedElement> |
nameContains(String infix)
Matches a
NamedElement for an infix of its name. |
static <T extends NamedElement> |
nameContainsIgnoreCase(String infix)
Matches a
NamedElement for an infix of its name. |
static <T extends NamedElement> |
named(String name)
Matches a
NamedElement for its exact name. |
static <T extends NamedElement> |
namedIgnoreCase(String name)
Matches a
NamedElement for its name. |
static <T extends NamedElement> |
nameEndsWith(String suffix)
Matches a
NamedElement for its name's suffix. |
static <T extends NamedElement> |
nameEndsWithIgnoreCase(String suffix)
Matches a
NamedElement for its name's suffix. |
static <T extends NamedElement> |
nameMatches(String regex)
Matches a
NamedElement name against a regular expression. |
static <T extends NamedElement> |
nameStartsWith(String prefix)
Matches a
NamedElement for its name's prefix. |
static <T extends NamedElement> |
nameStartsWithIgnoreCase(String prefix)
Matches a
NamedElement for its name's prefix. |
static <T> ElementMatcher.Junction<T> |
none()
Creates a matcher that always returns
false . |
static <T extends AnnotationDescription> |
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 MethodDescription> |
noneOf(Constructor<?>... value)
Creates a matcher that matches none of the given constructors as
MethodDescription s
by the Object.equals(Object) method. |
static <T extends FieldDescription> |
noneOf(Field... value)
Creates a matcher that matches none of the given methods as
FieldDescription s
by the Object.equals(Object) method. |
static <T> ElementMatcher.Junction<T> |
noneOf(Iterable<?> values)
Creates a matcher that matches none of the given objects by the
Object.equals(Object) method. |
static <T extends MethodDescription> |
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> |
noneOf(Object... value)
Creates a matcher that matches none of the given objects by the
Object.equals(Object) method. |
static <T extends TypeDefinition> |
noneOf(Type... value)
Creates a matcher that matches none of the given types as
TypeDescription s
by the Object.equals(Object) method. |
static <T> ElementMatcher.Junction<T> |
not(ElementMatcher<? super T> matcher)
Inverts another matcher.
|
static <T extends TypeDefinition> |
ofSort(ElementMatcher<? super TypeDefinition.Sort> matcher)
Matches generic type descriptions of the given sort.
|
static <T extends TypeDefinition> |
ofSort(TypeDefinition.Sort sort)
Matches generic type descriptions of the given sort.
|
static <T extends TypeDescription.Generic> |
rawType(Class<?> type)
Matches a generic type's raw type against the provided raw type.
|
static <T extends TypeDescription.Generic> |
rawType(ElementMatcher<? super TypeDescription> matcher)
Converts a matcher for a type description into a matcher for a raw type of the matched generic type against the given matcher.
|
static <T extends TypeDescription.Generic> |
rawType(TypeDescription type)
Matches a generic type's raw type against the provided raw type.
|
static <T extends Iterable<? extends TypeDescription.Generic>> |
rawTypes(Class<?>... type)
Matches an iteration of generic types' erasures against the provided raw types.
|
static <T extends Iterable<? extends TypeDescription.Generic>> |
rawTypes(ElementMatcher<? super Iterable<? extends TypeDescription>> matcher)
Applies the provided matcher to an iteration og generic types' generic types.
|
static <T extends Iterable<? extends TypeDescription.Generic>> |
rawTypes(Iterable<? extends TypeDescription> types)
Matches an iteration of generic types' erasures against the provided raw types.
|
static <T extends Iterable<? extends TypeDescription.Generic>> |
rawTypes(TypeDescription... type)
Matches an iteration of generic types' erasures against the provided raw types.
|
static <T extends MethodDescription> |
returns(Class<?> type)
Matches
MethodDescription s that return a given erasure type. |
static <T extends MethodDescription> |
returns(ElementMatcher<? super TypeDescription> matcher)
Matches a method's return type's erasure by the given matcher.
|
static <T extends MethodDescription> |
returns(TypeDescription type)
Matches
MethodDescription s that return a given erasure type. |
static <T extends MethodDescription> |
returnsGeneric(ElementMatcher<? super TypeDescription.Generic> matcher)
Matches
MethodDescription s that match a matched method's return type. |
static <T extends MethodDescription> |
returnsGeneric(Type type)
Matches
MethodDescription s that return a given generic type. |
static <T extends MethodDescription> |
returnsGeneric(TypeDescription.Generic type)
Matches
MethodDescription s that returns a given
TypeDescription . |
static <T extends MethodDescription> |
takesArgument(int index,
Class<?> type)
Matches
MethodDescription s that define a given generic type as a parameter at the given index. |
static <T extends MethodDescription> |
takesArgument(int index,
TypeDescription type)
Matches
MethodDescription s that define a given generic type as a parameter at the given index. |
static <T extends MethodDescription> |
takesArguments(Class<?>... type)
Matches a method description that takes the provided raw arguments.
|
static <T extends MethodDescription> |
takesArguments(int length)
Matches a
MethodDescription by the number of its parameters. |
static <T extends MethodDescription> |
takesArguments(Iterable<? extends TypeDescription> types)
Matches a method description that takes the provided raw arguments.
|
static <T extends MethodDescription> |
takesArguments(TypeDescription... type)
Matches a method description that takes the provided raw arguments.
|
static <T extends MethodDescription> |
takesGenericArgument(int index,
ElementMatcher<? super TypeDescription.Generic> matcher)
Matches
MethodDescription s that define a given generic type as a parameter at the given index. |
static <T extends MethodDescription> |
takesGenericArgument(int index,
Type type)
Matches
MethodDescription s that define a given generic type as a parameter at the given index. |
static <T extends MethodDescription> |
takesGenericArgument(int index,
TypeDescription.Generic type)
Matches
MethodDescription s that define a given generic type as a parameter at the given index. |
static <T extends MethodDescription> |
takesGenericArguments(ElementMatcher<? super Iterable<? extends TypeDescription.Generic>> matchers)
Matches a
MethodDescription by applying an iterable collection of element matcher on any parameter's TypeDescription . |
static <T extends MethodDescription> |
takesGenericArguments(List<? extends TypeDefinition> types)
Matches a method description that takes the provided generic arguments.
|
static <T extends MethodDescription> |
takesGenericArguments(Type... type)
Matches a method description that takes the provided generic arguments.
|
static <T extends MethodDescription> |
takesGenericArguments(TypeDefinition... type)
Matches a method description that takes the provided generic arguments.
|
static <T> ElementMatcher.Junction<Iterable<? extends T>> |
whereAny(ElementMatcher<? super T> matcher)
Matches an iterable by assuring that at least one element of the iterable collection matches the
provided matcher.
|
static <T> ElementMatcher.Junction<Iterable<? extends T>> |
whereNone(ElementMatcher<? super T> matcher)
Matches an iterable by assuring that no element of the iterable collection matches the provided matcher.
|
public static <T> ElementMatcher.Junction<T> failSafe(ElementMatcher<? super T> matcher)
Exception
.T
- The type of the matched object.matcher
- The element matcher that potentially throws an exception.false
in case that the given matcher throws an exception.public static <T> ElementMatcher.Junction<T> is(Object value)
null
by the Object.equals(Object)
method or
by a null-check.T
- The type of the matched object.value
- The value that is to be matched.public static <T extends FieldDescription> ElementMatcher.Junction<T> is(Field field)
FieldDescription
.T
- The type of the matched object.field
- The field to match by its descriptionpublic static <T extends FieldDescription> ElementMatcher.Junction<T> definedField(ElementMatcher<? super FieldDescription.InDefinedShape> matcher)
T
- The matched object's type.matcher
- The matcher to apply to the matched field's defined shape.public static <T extends MethodDescription> ElementMatcher.Junction<T> is(Method method)
MethodDescription
.T
- The type of the matched object.method
- The method to match by its descriptionpublic static <T extends MethodDescription> ElementMatcher.Junction<T> is(Constructor<?> constructor)
MethodDescription
.T
- The type of the matched object.constructor
- The constructor to match by its descriptionpublic static <T extends MethodDescription> ElementMatcher.Junction<T> definedMethod(ElementMatcher<? super MethodDescription.InDefinedShape> matcher)
T
- The matched object's type.matcher
- The matcher to apply to the matched method's defined shape.public static <T extends ParameterDescription> ElementMatcher.Junction<T> definedParameter(ElementMatcher<? super ParameterDescription.InDefinedShape> matcher)
T
- The matched object's type.matcher
- The matcher to apply to the matched parameter's defined shape.public static <T extends ParameterDescription> ElementMatcher.Junction<T> hasType(ElementMatcher<? super TypeDescription> matcher)
T
- The type of the matched object.matcher
- The matcher to apply to the parameter's type.public static <T extends ParameterDescription> ElementMatcher.Junction<T> hasGenericType(ElementMatcher<? super TypeDescription.Generic> matcher)
T
- The type of the matched object.matcher
- The matcher to apply to a parameter's generic type.public static <T extends TypeDefinition> ElementMatcher.Junction<T> is(Type type)
TypeDescription
.T
- The type of the matched object.type
- The type to match by its descriptionpublic static <T extends AnnotationDescription> ElementMatcher.Junction<T> is(Annotation annotation)
AnnotationDescription
.T
- The type of the matched object.annotation
- The annotation to match by its description.public static <T> ElementMatcher.Junction<T> not(ElementMatcher<? super T> matcher)
T
- The type of the matched object.matcher
- The matcher to invert.matcher
.public static <T> ElementMatcher.Junction<T> any()
true
.T
- The type of the matched object.public static <T> ElementMatcher.Junction<T> none()
false
.T
- The type of the matched object.public static <T> ElementMatcher.Junction<T> anyOf(Object... value)
Object.equals(Object)
method.
None of the values must be null
.T
- The type of the matched object.value
- The input values to be compared against.public static <T> ElementMatcher.Junction<T> anyOf(Iterable<?> values)
Object.equals(Object)
method.
None of the values must be null
.T
- The type of the matched object.values
- The input values to be compared against.public static <T extends TypeDefinition> ElementMatcher.Junction<T> anyOf(Type... value)
TypeDescription
s
by the Object.equals(Object)
method. None of the values must be null
.T
- The type of the matched object.value
- The input values to be compared against.public static <T extends MethodDescription> ElementMatcher.Junction<T> anyOf(Constructor<?>... value)
MethodDescription
s
by the Object.equals(Object)
method. None of the values must be null
.T
- The type of the matched object.value
- The input values to be compared against.public static <T extends MethodDescription> ElementMatcher.Junction<T> anyOf(Method... value)
MethodDescription
s
by the Object.equals(Object)
method. None of the values must be null
.T
- The type of the matched object.value
- The input values to be compared against.public static <T extends FieldDescription> ElementMatcher.Junction<T> anyOf(Field... value)
FieldDescription
s
by the Object.equals(Object)
method. None of the values must be null
.T
- The type of the matched object.value
- The input values to be compared against.public static <T extends AnnotationDescription> ElementMatcher.Junction<T> anyOf(Annotation... value)
AnnotationDescription
s
by the Object.equals(Object)
method. None of the values must be null
.T
- The type of the matched object.value
- The input values to be compared against.public static <T> ElementMatcher.Junction<T> noneOf(Object... value)
Object.equals(Object)
method.
None of the values must be null
.T
- The type of the matched object.value
- The input values to be compared against.public static <T> ElementMatcher.Junction<T> noneOf(Iterable<?> values)
Object.equals(Object)
method.
None of the values must be null
.T
- The type of the matched object.values
- The input values to be compared against.public static <T extends TypeDefinition> ElementMatcher.Junction<T> noneOf(Type... value)
TypeDescription
s
by the Object.equals(Object)
method. None of the values must be null
.T
- The type of the matched object.value
- The input values to be compared against.public static <T extends MethodDescription> ElementMatcher.Junction<T> noneOf(Constructor<?>... value)
MethodDescription
s
by the Object.equals(Object)
method. None of the values must be null
.T
- The type of the matched object.value
- The input values to be compared against.public static <T extends MethodDescription> ElementMatcher.Junction<T> noneOf(Method... value)
MethodDescription
s
by the Object.equals(Object)
method. None of the values must be null
.T
- The type of the matched object.value
- The input values to be compared against.public static <T extends FieldDescription> ElementMatcher.Junction<T> noneOf(Field... value)
FieldDescription
s
by the Object.equals(Object)
method. None of the values must be null
.T
- The type of the matched object.value
- The input values to be compared against.public static <T extends AnnotationDescription> ElementMatcher.Junction<T> noneOf(Annotation... value)
AnnotationDescription
s
by the Object.equals(Object)
method. None of the values must be null
.T
- The type of the matched object.value
- The input values to be compared against.public static <T> ElementMatcher.Junction<Iterable<? extends T>> whereAny(ElementMatcher<? super T> matcher)
T
- The type of the matched object.matcher
- The matcher to apply to each element.public static <T> ElementMatcher.Junction<Iterable<? extends T>> whereNone(ElementMatcher<? super T> matcher)
T
- The type of the matched object.matcher
- The matcher to apply to each element.public static <T extends TypeDescription.Generic> ElementMatcher.Junction<T> rawType(Class<?> type)
T
- The type of the matched object.type
- The type to match a generic type's erasure against.public static <T extends TypeDescription.Generic> ElementMatcher.Junction<T> rawType(TypeDescription type)
T
- The type of the matched object.type
- The type to match a generic type's erasure against.public static <T extends TypeDescription.Generic> ElementMatcher.Junction<T> rawType(ElementMatcher<? super TypeDescription> matcher)
T
- The type of the matched object.matcher
- The matcher to match the matched object's raw type against.public static <T extends Iterable<? extends TypeDescription.Generic>> ElementMatcher.Junction<T> rawTypes(Class<?>... type)
T
- The type of the matched object.type
- The types to match.public static <T extends Iterable<? extends TypeDescription.Generic>> ElementMatcher.Junction<T> rawTypes(TypeDescription... type)
T
- The type of the matched object.type
- The types to match.public static <T extends Iterable<? extends TypeDescription.Generic>> ElementMatcher.Junction<T> rawTypes(Iterable<? extends TypeDescription> types)
T
- The type of the matched object.types
- The types to match.public static <T extends Iterable<? extends TypeDescription.Generic>> ElementMatcher.Junction<T> rawTypes(ElementMatcher<? super Iterable<? extends TypeDescription>> matcher)
T
- The type of the matched object.matcher
- The matcher to apply at the erased types.public static <T extends TypeDefinition> ElementMatcher<T> isVariable(String symbol)
T
- The type of the matched object.symbol
- The name of the type variable to be match.public static <T extends TypeDefinition> ElementMatcher<T> isVariable(ElementMatcher<? super NamedElement> matcher)
T
- The type of the matched object.matcher
- A matcher for the type variable's name.public static <T extends NamedElement> ElementMatcher.Junction<T> named(String name)
NamedElement
for its exact name.T
- The type of the matched object.name
- The expected name.public static <T extends NamedElement> ElementMatcher.Junction<T> namedIgnoreCase(String name)
NamedElement
for its name. The name's
capitalization is ignored.T
- The type of the matched object.name
- The expected name.public static <T extends NamedElement> ElementMatcher.Junction<T> nameStartsWith(String prefix)
NamedElement
for its name's prefix.T
- The type of the matched object.prefix
- The expected name's prefix.public static <T extends NamedElement> ElementMatcher.Junction<T> nameStartsWithIgnoreCase(String prefix)
NamedElement
for its name's prefix. The name's
capitalization is ignored.T
- The type of the matched object.prefix
- The expected name's prefix.public static <T extends NamedElement> ElementMatcher.Junction<T> nameEndsWith(String suffix)
NamedElement
for its name's suffix.T
- The type of the matched object.suffix
- The expected name's suffix.public static <T extends NamedElement> ElementMatcher.Junction<T> nameEndsWithIgnoreCase(String suffix)
NamedElement
for its name's suffix. The name's
capitalization is ignored.T
- The type of the matched object.suffix
- The expected name's suffix.public static <T extends NamedElement> ElementMatcher.Junction<T> nameContains(String infix)
NamedElement
for an infix of its name.T
- The type of the matched object.infix
- The expected infix of the name.public static <T extends NamedElement> ElementMatcher.Junction<T> nameContainsIgnoreCase(String infix)
NamedElement
for an infix of its name. The name's
capitalization is ignored.T
- The type of the matched object.infix
- The expected infix of the name.public static <T extends NamedElement> ElementMatcher.Junction<T> nameMatches(String regex)
NamedElement
name against a regular expression.T
- The type of the matched object.regex
- The regular expression to match the name against.public static <T extends ByteCodeElement> ElementMatcher.Junction<T> hasDescriptor(String descriptor)
ByteCodeElement
's descriptor against a given value.T
- The type of the matched object.descriptor
- The expected descriptor.descriptor
.public static <T extends ByteCodeElement> ElementMatcher.Junction<T> isDeclaredBy(Class<?> type)
ByteCodeElement
for being declared by a given Class
. This matcher matches
a declared element's raw declaring type.T
- The type of the matched object.type
- The type that is expected to declare the matched byte code element.type
.public static <T extends ByteCodeElement> ElementMatcher.Junction<T> isDeclaredBy(TypeDescription type)
ByteCodeElement
for being declared by a given TypeDescription
. This matcher matches
a declared element's raw declaring type.T
- The type of the matched object.type
- The type that is expected to declare the matched byte code element.type
.public static <T extends ByteCodeElement> ElementMatcher.Junction<T> isDeclaredBy(ElementMatcher<? super TypeDescription> matcher)
ByteCodeElement
for being declared by a TypeDescription
that is matched by the given matcher. This matcher matches
a declared element's raw declaring type.T
- The type of the matched object.matcher
- A matcher for the declaring type of the matched byte code element as long as it
is not null
.matcher
.public static <T extends ByteCodeElement> ElementMatcher.Junction<T> isDeclaredByGeneric(Type type)
ByteCodeElement
for being declared by a given generic Type
.T
- The type of the matched object.type
- The type that is expected to declare the matched byte code element.type
.public static <T extends ByteCodeElement> ElementMatcher.Junction<T> isDeclaredByGeneric(TypeDescription.Generic type)
ByteCodeElement
for being declared by a given TypeDescription.Generic
.T
- The type of the matched object.type
- The type that is expected to declare the matched byte code element.type
.public static <T extends ByteCodeElement> ElementMatcher.Junction<T> isDeclaredByGeneric(ElementMatcher<? super TypeDescription.Generic> matcher)
ByteCodeElement
for being declared by a TypeDescription.Generic
that is matched by the given matcher.T
- The type of the matched object.matcher
- A matcher for the declaring type of the matched byte code element as long as it is not null
.matcher
.public static <T extends ByteCodeElement> ElementMatcher.Junction<T> isVisibleTo(Class<?> type)
ByteCodeElement
that is visible to a given Class
.T
- The type of the matched object.type
- The type that a matched byte code element is expected to be visible to.type
.public static <T extends ByteCodeElement> ElementMatcher.Junction<T> isVisibleTo(TypeDescription type)
ByteCodeElement
that is visible to a given
TypeDescription
.T
- The type of the matched object.type
- The type that a matched byte code element is expected to be visible to.type
.public static <T extends ModifierReviewable> ElementMatcher.Junction<T> isAbstract()
ModifierReviewable
that is abstract
.T
- The type of the matched object.abstract
modifier reviewable.public static <T extends AnnotatedCodeElement> ElementMatcher.Junction<T> isAnnotatedWith(Class<? extends Annotation> type)
AnnotatedCodeElement
for declared annotations.
This matcher does not match inherited annotations which only exist for classes. Use
inheritsAnnotation(Class)
for matching inherited annotations.T
- The type of the matched object.type
- The annotation type to match against.type
.public static <T extends AnnotatedCodeElement> ElementMatcher.Junction<T> isAnnotatedWith(TypeDescription type)
AnnotatedCodeElement
for declared annotations.
This matcher does not match inherited annotations which only exist for classes. Use
inheritsAnnotation(TypeDescription)
for matching inherited annotations.T
- The type of the matched object.type
- The annotation type to match against.type
.public static <T extends AnnotatedCodeElement> ElementMatcher.Junction<T> isAnnotatedWith(ElementMatcher<? super TypeDescription> matcher)
AnnotatedCodeElement
for declared annotations.
This matcher does not match inherited annotations which only exist for classes. Use
inheritsAnnotation(net.bytebuddy.matcher.ElementMatcher)
for matching inherited annotations.T
- The type of the matched object.matcher
- The matcher to apply to any annotation's type found on the matched annotated element.matcher
.public static <T extends AnnotatedCodeElement> ElementMatcher.Junction<T> declaresAnnotation(ElementMatcher<? super AnnotationDescription> matcher)
AnnotatedCodeElement
to declare any annotation
that matches the given matcher. Note that this matcher does not match inherited annotations that only exist
for types. Use inheritsAnnotation(net.bytebuddy.matcher.ElementMatcher)
for matching inherited annotations.T
- The type of the matched object.matcher
- A matcher to apply on any declared annotation of the matched annotated element.matcher
.public static <T extends ModifierReviewable> ElementMatcher.Junction<T> isPublic()
ModifierReviewable
that is public
.T
- The type of the matched object.public
modifier reviewable.public static <T extends ModifierReviewable> ElementMatcher.Junction<T> isProtected()
ModifierReviewable
that is protected
.T
- The type of the matched object.protected
modifier reviewable.public static <T extends ModifierReviewable> ElementMatcher.Junction<T> isPackagePrivate()
ModifierReviewable
that is package-private.T
- The type of the matched object.public static <T extends ModifierReviewable> ElementMatcher.Junction<T> isPrivate()
ModifierReviewable
that is private
.T
- The type of the matched object.private
modifier reviewable.public static <T extends ModifierReviewable> ElementMatcher.Junction<T> isFinal()
ModifierReviewable
that is final
.T
- The type of the matched object.final
modifier reviewable.public static <T extends ModifierReviewable> ElementMatcher.Junction<T> isStatic()
ModifierReviewable
that is static
.T
- The type of the matched object.static
modifier reviewable.public static <T extends ModifierReviewable> ElementMatcher.Junction<T> isSynthetic()
ModifierReviewable
that is synthetic.T
- The type of the matched object.public static <T extends MethodDescription> ElementMatcher.Junction<T> isSynchronized()
MethodDescription
that is synchronized
.T
- The type of the matched object.synchronized
method description.public static <T extends MethodDescription> ElementMatcher.Junction<T> isNative()
MethodDescription
that is native
.T
- The type of the matched object.native
method description.public static <T extends MethodDescription> ElementMatcher.Junction<T> isStrict()
MethodDescription
that is strictfp
.T
- The type of the matched object.strictfp
method description.public static <T extends MethodDescription> ElementMatcher.Junction<T> isVarArgs()
MethodDescription
that is a var-args.T
- The type of the matched object.public static <T extends MethodDescription> ElementMatcher.Junction<T> isBridge()
MethodDescription
that is a bridge.T
- The type of the matched object.public static <T extends MethodDescription> ElementMatcher.Junction<T> returnsGeneric(Type type)
MethodDescription
s that return a given generic type.T
- The type of the matched object.type
- The generic type the matched method is expected to return.public static <T extends MethodDescription> ElementMatcher.Junction<T> returnsGeneric(TypeDescription.Generic type)
MethodDescription
s that returns a given
TypeDescription
.T
- The type of the matched object.type
- The type the matched method is expected to return.public static <T extends MethodDescription> ElementMatcher.Junction<T> returns(Class<?> type)
MethodDescription
s that return a given erasure type.T
- The type of the matched object.type
- The raw type the matched method is expected to return.public static <T extends MethodDescription> ElementMatcher.Junction<T> returns(TypeDescription type)
MethodDescription
s that return a given erasure type.T
- The type of the matched object.type
- The raw type the matched method is expected to return.public static <T extends MethodDescription> ElementMatcher.Junction<T> returns(ElementMatcher<? super TypeDescription> matcher)
T
- The type of the matched object.matcher
- The matcher to apply to a method's return type's erasure.public static <T extends MethodDescription> ElementMatcher.Junction<T> returnsGeneric(ElementMatcher<? super TypeDescription.Generic> matcher)
MethodDescription
s that match a matched method's return type.T
- The type of the matched object.matcher
- A matcher to apply onto a matched method's return type.matcher
.public static <T extends MethodDescription> ElementMatcher.Junction<T> takesGenericArgument(int index, Type type)
MethodDescription
s that define a given generic type as a parameter at the given index.T
- The type of the matched object.index
- The index of the parameter.type
- The generic type the matched method is expected to define as a parameter type.public static <T extends MethodDescription> ElementMatcher.Junction<T> takesGenericArgument(int index, TypeDescription.Generic type)
MethodDescription
s that define a given generic type as a parameter at the given index.T
- The type of the matched object.index
- The index of the parameter.type
- The generic type the matched method is expected to define as a parameter type.public static <T extends MethodDescription> ElementMatcher.Junction<T> takesGenericArgument(int index, ElementMatcher<? super TypeDescription.Generic> matcher)
MethodDescription
s that define a given generic type as a parameter at the given index.T
- The type of the matched object.index
- The index of the parameter.matcher
- A matcher for the generic type the matched method is expected to define as a parameter type.public static <T extends MethodDescription> ElementMatcher.Junction<T> takesGenericArguments(Type... type)
T
- The type of the matched object.type
- The arguments to match against the matched method.public static <T extends MethodDescription> ElementMatcher.Junction<T> takesGenericArguments(TypeDefinition... type)
T
- The type of the matched object.type
- The arguments to match against the matched method.public static <T extends MethodDescription> ElementMatcher.Junction<T> takesGenericArguments(List<? extends TypeDefinition> types)
T
- The type of the matched object.types
- The arguments to match against the matched method.public static <T extends MethodDescription> ElementMatcher.Junction<T> takesGenericArguments(ElementMatcher<? super Iterable<? extends TypeDescription.Generic>> matchers)
MethodDescription
by applying an iterable collection of element matcher on any parameter's TypeDescription
.T
- The type of the matched object.matchers
- The matcher that are applied onto the parameter types of the matched method description.public static <T extends MethodDescription> ElementMatcher.Junction<T> takesArgument(int index, Class<?> type)
MethodDescription
s that define a given generic type as a parameter at the given index.T
- The type of the matched object.index
- The index of the parameter.type
- The erasure of the type the matched method is expected to define as a parameter type.public static <T extends MethodDescription> ElementMatcher.Junction<T> takesArgument(int index, TypeDescription type)
MethodDescription
s that define a given generic type as a parameter at the given index.T
- The type of the matched object.index
- The index of the parameter.type
- The erasure of the type the matched method is expected to define as a parameter type.public static <T extends MethodDescription> ElementMatcher.Junction<T> takesArguments(Class<?>... type)
T
- The type of the matched object.type
- The arguments to match against the matched method.public static <T extends MethodDescription> ElementMatcher.Junction<T> takesArguments(TypeDescription... type)
T
- The type of the matched object.type
- The arguments to match against the matched method.public static <T extends MethodDescription> ElementMatcher.Junction<T> takesArguments(Iterable<? extends TypeDescription> types)
T
- The type of the matched object.types
- The arguments to match against the matched method.public static <T extends MethodDescription> ElementMatcher.Junction<T> takesArguments(int length)
MethodDescription
by the number of its parameters.T
- The type of the matched object.length
- The expected length.public static <T extends MethodDescription> ElementMatcher.Junction<T> hasParameters(ElementMatcher<? super Iterable<? extends ParameterDescription>> matcher)
MethodDescription
by validating that its parameters
fulfill a given constraint.T
- The type of the matched object.matcher
- The matcher to apply for validating the parameters.public static <T extends MethodDescription> ElementMatcher.Junction<T> canThrow(Class<? extends Throwable> exceptionType)
MethodDescription
by its capability to throw a given
checked exception. For specifying a non-checked exception, any method is matched.T
- The type of the matched object.exceptionType
- The type of the exception that should be declared by the method to be matched.public static <T extends MethodDescription> ElementMatcher.Junction<T> canThrow(TypeDescription exceptionType)
MethodDescription
by its capability to throw a given
checked exception. For specifying a non-checked exception, any method is matched.T
- The type of the matched object.exceptionType
- The type of the exception that should be declared by the method to be matched.public static <T extends MethodDescription> ElementMatcher.Junction<T> declaresGenericException(Type exceptionType)
declaresException(Class)
. For exceptions that are expressed as type variables, only exceptions
that are represented as this type variable are matched.T
- The type of the matched object.exceptionType
- The generic exception type that is matched exactly.public static <T extends MethodDescription> ElementMatcher.Junction<T> declaresGenericException(TypeDescription.Generic exceptionType)
declaresException(TypeDescription)
. For exceptions that are expressed as type variables, only exceptions
that are represented as this type variable are matched.T
- The type of the matched object.exceptionType
- The generic exception type that is matched exactly.public static <T extends MethodDescription> ElementMatcher.Junction<T> declaresException(Class<? extends Throwable> exceptionType)
T
- The type of the matched object.exceptionType
- The exception type that is matched.public static <T extends MethodDescription> ElementMatcher.Junction<T> declaresException(TypeDescription exceptionType)
T
- The type of the matched object.exceptionType
- The exception type that is matched.public static <T extends MethodDescription> ElementMatcher.Junction<T> declaresGenericException(ElementMatcher<? super Iterable<? extends TypeDescription.Generic>> exceptionMatcher)
T
- The type of the matched object.exceptionMatcher
- The exception matcher to apply onto the matched method's generic exceptions.public static <T extends TypeDescription> ElementMatcher.Junction<T> isInterface()
TypeDescription
that is an interface.T
- The type of the matched object.public static <T extends MethodDescription> ElementMatcher.Junction<T> isMethod()
Method
.T
- The type of the matched object.public static <T extends MethodDescription> ElementMatcher.Junction<T> isConstructor()
Constructor
.T
- The type of the matched object.public static <T extends MethodDescription> ElementMatcher.Junction<T> isTypeInitializer()
Class
type initializer.T
- The type of the matched object.public static <T extends MethodDescription> ElementMatcher.Junction<T> isVirtual()
T
- The type of the matched object.public static <T extends MethodDescription> ElementMatcher.Junction<T> isDefaultMethod()
T
- The type of the matched object.public static <T extends MethodDescription> ElementMatcher.Junction<T> isDefaultConstructor()
T
- The type of the matched object.public static <T extends MethodDescription> ElementMatcher.Junction<T> isDefaultFinalizer()
Object.finalize()
method if it was not overridden.T
- The type of the matched object.Object.finalize()
method.public static <T extends MethodDescription> ElementMatcher.Junction<T> isFinalizer()
Object.finalize()
method, even if it was overridden.T
- The type of the matched object.Object.finalize()
method.public static <T extends MethodDescription> ElementMatcher.Junction<T> isHashCode()
Object.toString()
method, also if it was overridden.T
- The type of the matched object.Object.toString()
method.public static <T extends MethodDescription> ElementMatcher.Junction<T> isEquals()
Object.equals(Object)
method, also if it was overridden.T
- The type of the matched object.Object.equals(Object)
method.public static <T extends MethodDescription> ElementMatcher.Junction<T> isClone()
Object.clone()
method, also if it was overridden.T
- The type of the matched object.Object.clone()
method.public static <T extends MethodDescription> ElementMatcher.Junction<T> isToString()
Object.toString()
method, also if it was overridden.T
- The type of the matched object.Object.toString()
method.public static <T extends MethodDescription> ElementMatcher.Junction<T> isSetter()
T
- The type of the matched object.public static <T extends MethodDescription> ElementMatcher.Junction<T> isSetter(Type type)
T
- The type of the matched object.type
- The required setter type.public static <T extends MethodDescription> ElementMatcher.Junction<T> isSetter(TypeDescription.Generic type)
T
- The type of the matched object.type
- The required setter type.public static <T extends MethodDescription> ElementMatcher.Junction<T> isSetter(ElementMatcher<? super TypeDescription.Generic> matcher)
T
- The type of the matched object.matcher
- A matcher to be allied to a setter method's argument type.public static <T extends MethodDescription> ElementMatcher.Junction<T> isGetter()
T
- The type of the matched object.public static <T extends MethodDescription> ElementMatcher.Junction<T> isGetter(Type type)
T
- The type of the matched object.type
- The required getter type.public static <T extends MethodDescription> ElementMatcher.Junction<T> isGetter(TypeDescription.Generic type)
T
- The type of the matched object.type
- The required getter type.public static <T extends MethodDescription> ElementMatcher.Junction<T> isGetter(ElementMatcher<? super TypeDescription.Generic> matcher)
T
- The type of the matched object.matcher
- A matcher to be allied to a getter method's argument type.public static <T extends MethodDescription> ElementMatcher.Junction<T> hasMethodName(String internalName)
T
- The type of the matched object.internalName
- The internal name of the method.public static <T extends TypeDescription> ElementMatcher.Junction<T> isSubTypeOf(Class<?> type)
T
- The type of the matched object.type
- The type to be checked being a super type of the matched type.public static <T extends TypeDescription> ElementMatcher.Junction<T> isSubTypeOf(TypeDescription type)
T
- The type of the matched object.type
- The type to be checked being a super type of the matched type.public static <T extends TypeDescription> ElementMatcher.Junction<T> isSuperTypeOf(Class<?> type)
T
- The type of the matched object.type
- The type to be checked being a subtype of the matched type.public static <T extends TypeDescription> ElementMatcher.Junction<T> isSuperTypeOf(TypeDescription type)
T
- The type of the matched object.type
- The type to be checked being a subtype of the matched type.public static <T extends TypeDescription> ElementMatcher.Junction<T> inheritsAnnotation(Class<?> type)
T
- The type of the matched object.type
- The annotation type to be matched.public static <T extends TypeDescription> ElementMatcher.Junction<T> inheritsAnnotation(TypeDescription type)
T
- The type of the matched object.type
- The annotation type to be matched.public static <T extends TypeDescription> ElementMatcher.Junction<T> inheritsAnnotation(ElementMatcher<? super TypeDescription> matcher)
T
- The type of the matched object.matcher
- A matcher to apply onto the inherited annotations.public static <T extends TypeDescription> ElementMatcher.Junction<T> hasAnnotation(ElementMatcher<? super AnnotationDescription> matcher)
T
- The type of the matched object.matcher
- A matcher to apply onto a list of inherited annotations.public static <T extends TypeDefinition> ElementMatcher.Junction<T> declaresField(ElementMatcher<? super FieldDescription> fieldMatcher)
T
- The type of the matched object.fieldMatcher
- The matcher that is applied onto each declared field.public static <T extends TypeDefinition> ElementMatcher.Junction<T> declaresMethod(ElementMatcher<? super MethodDescription> methodMatcher)
T
- The type of the matched object.methodMatcher
- The matcher that is applied onto each declared method.public static <T extends TypeDefinition> ElementMatcher.Junction<T> ofSort(TypeDefinition.Sort sort)
T
- The type of the matched object.sort
- The generic type sort to match.public static <T extends TypeDefinition> ElementMatcher.Junction<T> ofSort(ElementMatcher<? super TypeDefinition.Sort> matcher)
T
- The type of the matched object.matcher
- A matcher for a generic type's sort.public static <T extends FieldDescription> ElementMatcher.Junction<T> genericFieldType(Type fieldType)
T
- The type of the matched object.fieldType
- The field type to match.public static <T extends FieldDescription> ElementMatcher.Junction<T> genericFieldType(TypeDescription.Generic fieldType)
T
- The type of the matched object.fieldType
- The field type to match.public static <T extends FieldDescription> ElementMatcher.Junction<T> genericFieldType(ElementMatcher<? super TypeDescription.Generic> matcher)
T
- The type of the matched object.matcher
- The matcher to apply to the field's type.public static <T extends FieldDescription> ElementMatcher.Junction<T> fieldType(Class<?> fieldType)
T
- The type of the matched object.fieldType
- The field type to match.public static <T extends FieldDescription> ElementMatcher.Junction<T> fieldType(TypeDescription fieldType)
T
- The type of the matched object.fieldType
- The field type to match.public static <T extends FieldDescription> ElementMatcher.Junction<T> fieldType(ElementMatcher<? super TypeDescription> matcher)
T
- The type of the matched object.matcher
- The matcher to apply to the field's type.public static <T extends ClassLoader> ElementMatcher<T> isBootstrapClassLoader()
ClassLoader
. The returned matcher is a synonym to
a matcher matching null
.T
- The type of the matched object.public static <T extends ClassLoader> ElementMatcher<T> isSystemClassLoader()
ClassLoader
. The returned matcher is a synonym to
a matcher matching ClassLoader.gerSystemClassLoader()
.T
- The type of the matched object.public static <T extends ClassLoader> ElementMatcher<T> isExtensionClassLoader()
ClassLoader
. The returned matcher is a synonym to
a matcher matching ClassLoader.gerSystemClassLoader().getParent()
.T
- The type of the matched object.public static <T extends ClassLoader> ElementMatcher<T> isChildOf(ClassLoader classLoader)
T
- The type of the matched object.classLoader
- The class loader of which child class loaders are matched.public static <T extends ClassLoader> ElementMatcher<T> hasChild(ElementMatcher<? super ClassLoader> matcher)
T
- The type of the matched object.matcher
- The matcher to apply to all class loaders in the hierarchy of the matched class loader.public static <T extends ClassLoader> ElementMatcher<T> isParentOf(ClassLoader classLoader)
T
- The type of the matched object.classLoader
- The class loader of which parent class loaders are matched.Copyright © 2014–2016. All rights reserved.