Top Description Interfaces Classes
[default module]

Package net.bytebuddy.matcher

Annotations
@ByDefault
Imports
net.bytebuddy.utility.nullability.NeverNull

Contains an API for matching Java byte code entities.

Interface Summary

Modifier and TypeInterface and Description
public interface
ElementMatcher<
The type of the object that is being matched.
T
>

An element matcher is used as a predicate for identifying code elements such as types, methods, fields or annotations.

public interface
FilterableList<
The type of the collection's elements.
T
,
The type of this list.
S extends FilterableList<T, S>
>

A filterable list allows to use an net.bytebuddy.matcher.ElementMatcher to reduce a lists to elements that are matched by this matcher in this list.

public interface
LatentMatcher<
The type of the matched element.
T
>

A latent matcher that resolves an ElementMatcher after supplying a type description.

Class Summary

Modifier and TypeClass and Description
public class
AccessibilityMatcher<
The type of the matched entity.
T extends ByteCodeElement
>

An element matcher that validates that a given byte code element is accessible to a given type.

public class
AnnotationTargetMatcher<
The type of the matched entity.
T extends AnnotationDescription
>

A matcher for annotations that target a given element type.

public class
AnnotationTypeMatcher<
The exact type of the annotation description that is matched.
T extends AnnotationDescription
>

An element matcher that matches the type of an annotation description.

public class
ArrayTypeMatcher<
The type of the matched entity.
T extends TypeDefinition
>

Matches an enumeration type.

public class
BooleanMatcher<
The actual matched type of this matcher.
T
>

An element matcher that returns a fixed result.

public class
CachingMatcher<
The actual matched type of this matcher.
T
>

A matcher that remembers the results of previously matching an equal target.

public class
ClassFileVersionMatcher<
The exact type of the type description that is matched.
T extends TypeDescription
>

A matcher to consider if a class file version reaches a given boundary.

public class
ClassLoaderHierarchyMatcher<
The exact type of the class loader that is matched.
T extends ClassLoader
>

An element matcher that matches all java.lang.ClassLoaders in the matched class loaders hierarchy against a given matcher.

public class
ClassLoaderParentMatcher<
The exact type of the class loader that is matched.
T extends ClassLoader
>

An element matcher that matches a class loader for being a parent of the given class loader.

public class
CollectionElementMatcher<
The type of the elements contained by the collection.
T
>

A matcher that matches a given element of a collection.

public class
CollectionErasureMatcher<
The type of the matched entity.
T extends Iterable<? extends TypeDefinition>
>

An element matcher that matches a collection of types by their erasures.

public class
CollectionItemMatcher<
The type of the matched entity.
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.

public class
CollectionOneToOneMatcher<
The type of the matched entity.
T
>

An element matcher that matches a given iterable collection to a list of matchers on a per-element basis.

public class
CollectionSizeMatcher<
The type of the matched entity.
T extends Iterable<?>
>

An element matcher that matches a collection by its size.

public class
DeclaringAnnotationMatcher<
The actual matched type of this matcher.
T extends AnnotationSource
>

An element matcher that matches the list of annotations that are provided by an annotated element.

public class
DeclaringFieldMatcher<
The exact type of the annotated element that is matched.
T extends TypeDefinition
>

An element matcher that checks if a type description declares fields of a given property.

public class
DeclaringMethodMatcher<
The exact type of the annotated element that is matched.
T extends TypeDefinition
>

An element matcher that checks if a type description declares methods of a given property.

public class
DeclaringTypeMatcher<
The exact type of the element being matched.
T extends DeclaredByType
>

An element matcher that matches the declaring type of another element, only if this element is actually declared in a type.

public class
DefinedShapeMatcher<
The type of the matched entity.
T extends ByteCodeElement.TypeDependant<S, ?>
,
The type of the defined shape of the matched entity.
S extends ByteCodeElement.TypeDependant<?, ?>
>

An element matcher that matches a byte code's element's token against a matcher for such a token.

public class
DescriptorMatcher<
The type of the matched entity.
T extends NamedElement.WithDescriptor
>

An element matcher that matches a Java descriptor.

public class
ElementMatchers

A utility class that contains a human-readable language for creating net.bytebuddy.matcher.ElementMatchers.

public class
EqualityMatcher<
The type of the matched entity.
T
>

An element matcher that checks an object's equality to another object.

public class
ErasureMatcher<
The type of the matched entity.
T extends TypeDefinition
>

An element matcher that matches its argument's TypeDescription.Generic raw type against the given matcher for a TypeDescription.

public class
FailSafeMatcher<
The type of the matched entity.
T
>

A fail-safe matcher catches exceptions that are thrown by a delegate matcher and returns an alternative value.

public class
FieldTypeMatcher<
The type of the matched entity.
T extends FieldDescription
>

An element matcher that matches a field's type.

public class
HasSuperClassMatcher<
The type of the matched entity.
T extends TypeDescription
>

An element matcher that matches a super class.

public class
HasSuperTypeMatcher<
The type of the matched entity.
T extends TypeDescription
>

An element matcher that matches a super type.

public class
InheritedAnnotationMatcher<
The actual matched type of this matcher.
T extends TypeDescription
>

An element matcher that matches the list of inherited annotations of a type description.

public class
InstanceTypeMatcher<
The exact type of the object that is matched.
T
>

An element matcher that matches an object's type.

public class
IsNamedMatcher<
The type of the matched entity.
T extends NamedElement.WithOptionalName
>

An element matcher that matches a named element only if is explicitly named.

public class
MethodExceptionTypeMatcher<
The type of the matched entity.
T extends MethodDescription
>

An element matcher that matches the exceptions that are declared by a method.

public class
MethodOverrideMatcher<
The type of the matched entity.
T extends MethodDescription
>

A matcher that checks if any super type of a type declares a method with the same shape of a matched method.

public class
MethodParametersMatcher<
The type of the matched entity.
T extends MethodDescription
>

An element matcher that matches a method's parameters.

public class
MethodParameterTypeMatcher<
The type of the matched entity.
T extends ParameterDescription
>

An element matcher that matches a method's parameter's type.

public class
MethodParameterTypesMatcher<
The type of the matched entity.
T extends ParameterList<?>
>

An element matcher that matches a method's parameter types.

public class
MethodReturnTypeMatcher<
The type of the matched entity.
T extends MethodDescription
>

An element matcher that matches its argument's return type against a given type matcher.

public class
MethodSortMatcher<
The type of the matched entity.
T extends MethodDescription
>

Matches a method description by its general characteristics which are represented as a net.bytebuddy.matcher.MethodSortMatcher.Sort.

public class
ModifierMatcher<
The type of the matched entity.
T extends ModifierReviewable
>

An element matcher that matches a byte code element by its modifiers.

public class
NameMatcher<
The type of the matched entity.
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 dollar signs 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.
public class
NegatingMatcher<
The type of the matched entity.
T
>

An element matcher that reverses the matching result of another matcher.

public class
NullMatcher<
The type of the matched entity.
T
>

An element matcher that matches the null value.

public class
PrimitiveTypeMatcher<
The type of the matched entity.
T extends TypeDefinition
>

Matches a primitive type.

public class
RecordMatcher<
The type of the matched entity.
T extends TypeDefinition
>

Matches a record.

public class
SignatureTokenMatcher<
The type of the matched entity.
T extends MethodDescription
>

Matches a method description's signature token against another matcher.

public class
StringMatcher

An element matcher that compares two strings by a given pattern which is characterized by a net.bytebuddy.matcher.StringMatcher.Mode.

public class
StringSetMatcher

An element matcher which checks if a string is in a set of strings.

public class
SubTypeMatcher<
The type of the matched entity.
T extends TypeDescription
>

An element matcher that matches its argument for being another type's subtype.

public class
SuperTypeMatcher<
The type of the matched entity.
T extends TypeDescription
>

An element matcher that matches its argument for being another type's super type.

public class
TypeSortMatcher<
The type of the matched entity.
T extends TypeDefinition
>

An element matcher that validates that a given generic type description represents a type of a given name.

public class
VisibilityMatcher<
The type of the matched entity.
T extends ByteCodeElement
>

An element matcher that validates that a given byte code element is visible to a given type.