Class CustomElementMatchers
- java.lang.Object
-
- co.elastic.apm.agent.bci.bytebuddy.CustomElementMatchers
-
public class CustomElementMatchers extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description CustomElementMatchers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static net.bytebuddy.matcher.ElementMatcher.Junction<net.bytebuddy.description.annotation.AnnotationSource>annotationMatches(java.lang.String annotationWildcard)static net.bytebuddy.matcher.ElementMatcher.Junction<net.bytebuddy.description.NamedElement>anyMatch(java.util.List<WildcardMatcher> matchers)static net.bytebuddy.matcher.ElementMatcher.Junction<java.lang.ClassLoader>classLoaderCanLoadClass(java.lang.String className)Matches only class loaders which can load a certain class.static net.bytebuddy.matcher.ElementMatcher.Junction<java.security.ProtectionDomain>implementationVersionGte(java.lang.String version)static net.bytebuddy.matcher.ElementMatcher.Junction<java.security.ProtectionDomain>implementationVersionLte(java.lang.String version)A matcher that checks whether the implementation version read from the MANIFEST.MF related for a givenProtectionDomainis lower than or equals to the limit version.static net.bytebuddy.matcher.ElementMatcher.Junction<net.bytebuddy.description.NamedElement>isInAnyPackage(java.util.Collection<java.lang.String> includedPackages, net.bytebuddy.matcher.ElementMatcher.Junction<net.bytebuddy.description.NamedElement> defaultIfEmpty)static <T extends net.bytebuddy.description.NamedElement>
net.bytebuddy.matcher.ElementMatcher.Junction<T>isProxy()static net.bytebuddy.matcher.ElementMatcher.Junction<net.bytebuddy.description.NamedElement>matches(WildcardMatcher matcher)static MethodHierarchyMatcheroverridesOrImplementsMethodThat(net.bytebuddy.matcher.ElementMatcher<? super net.bytebuddy.description.method.MethodDescription> methodElementMatcher)Matches overridden methods of a super class or implemented methods of an interface.
-
-
-
Method Detail
-
isInAnyPackage
public static net.bytebuddy.matcher.ElementMatcher.Junction<net.bytebuddy.description.NamedElement> isInAnyPackage(java.util.Collection<java.lang.String> includedPackages, net.bytebuddy.matcher.ElementMatcher.Junction<net.bytebuddy.description.NamedElement> defaultIfEmpty)
-
classLoaderCanLoadClass
public static net.bytebuddy.matcher.ElementMatcher.Junction<java.lang.ClassLoader> classLoaderCanLoadClass(java.lang.String className)
Matches only class loaders which can load a certain class.Warning: the class will be tried to load by each class loader. You should choose a class which does not have optional dependencies (imports classes which are not on the class path). Ideally, choose an interface or annotation without dependencies.
- Parameters:
className- the name of the class to check- Returns:
- a matcher which only matches class loaders which can load a certain class.
-
implementationVersionLte
public static net.bytebuddy.matcher.ElementMatcher.Junction<java.security.ProtectionDomain> implementationVersionLte(java.lang.String version)
A matcher that checks whether the implementation version read from the MANIFEST.MF related for a givenProtectionDomainis lower than or equals to the limit version. Assumes a SemVer version format.- Parameters:
version- the version to check against- Returns:
- an LTE SemVer matcher
-
implementationVersionGte
public static net.bytebuddy.matcher.ElementMatcher.Junction<java.security.ProtectionDomain> implementationVersionGte(java.lang.String version)
-
overridesOrImplementsMethodThat
public static MethodHierarchyMatcher overridesOrImplementsMethodThat(net.bytebuddy.matcher.ElementMatcher<? super net.bytebuddy.description.method.MethodDescription> methodElementMatcher)
Matches overridden methods of a super class or implemented methods of an interface. Recursively traverses the superclasses and interfaces. The the superclasses and interfaces to examine can be limited viaMethodHierarchyMatcher.onSuperClassesThat(ElementMatcher).- Parameters:
methodElementMatcher- The matcher which is applied on the method hierarchy- Returns:
- a matcher which is applied on the method hierarchy
-
matches
public static net.bytebuddy.matcher.ElementMatcher.Junction<net.bytebuddy.description.NamedElement> matches(WildcardMatcher matcher)
-
anyMatch
public static net.bytebuddy.matcher.ElementMatcher.Junction<net.bytebuddy.description.NamedElement> anyMatch(java.util.List<WildcardMatcher> matchers)
-
annotationMatches
public static net.bytebuddy.matcher.ElementMatcher.Junction<net.bytebuddy.description.annotation.AnnotationSource> annotationMatches(java.lang.String annotationWildcard)
-
isProxy
public static <T extends net.bytebuddy.description.NamedElement> net.bytebuddy.matcher.ElementMatcher.Junction<T> isProxy()
-
-