@HashCodeAndEqualsPlugin.Enhance public static class AgentBuilder.RawMatcher.ForElementMatchers extends java.lang.Object implements AgentBuilder.RawMatcher
TypeDescription
and its ClassLoader against two suitable matchers in order to determine if the matched
type should be instrumented.AgentBuilder.RawMatcher.Conjunction, AgentBuilder.RawMatcher.Disjunction, AgentBuilder.RawMatcher.ForElementMatchers, AgentBuilder.RawMatcher.ForLoadState, AgentBuilder.RawMatcher.ForResolvableTypes, AgentBuilder.RawMatcher.Inversion, AgentBuilder.RawMatcher.Trivial| Modifier and Type | Field and Description |
|---|---|
private ElementMatcher<? super java.lang.ClassLoader> |
classLoaderMatcher
The class loader matcher to apply to a
ClassLoader. |
private ElementMatcher<? super JavaModule> |
moduleMatcher
A module matcher to apply to a
java.lang.Module. |
private ElementMatcher<? super TypeDescription> |
typeMatcher
The type matcher to apply to a
TypeDescription. |
| Constructor and Description |
|---|
ForElementMatchers(ElementMatcher<? super TypeDescription> typeMatcher)
Creates a new
AgentBuilder.RawMatcher that only matches the
supplied TypeDescription against a supplied matcher. |
ForElementMatchers(ElementMatcher<? super TypeDescription> typeMatcher,
ElementMatcher<? super java.lang.ClassLoader> classLoaderMatcher)
Creates a new
AgentBuilder.RawMatcher that only matches the
supplied TypeDescription and its ClassLoader against two matcher in order
to decided if an instrumentation should be conducted. |
ForElementMatchers(ElementMatcher<? super TypeDescription> typeMatcher,
ElementMatcher<? super java.lang.ClassLoader> classLoaderMatcher,
ElementMatcher<? super JavaModule> moduleMatcher)
Creates a new
AgentBuilder.RawMatcher that only matches the
supplied TypeDescription, its ClassLoader and module against element
suitable matchers. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
matches(TypeDescription typeDescription,
java.lang.ClassLoader classLoader,
JavaModule module,
java.lang.Class<?> classBeingRedefined,
java.security.ProtectionDomain protectionDomain)
Decides if the given
typeDescription should be instrumented with the entailed
AgentBuilder.Transformers. |
private final ElementMatcher<? super TypeDescription> typeMatcher
TypeDescription.private final ElementMatcher<? super java.lang.ClassLoader> classLoaderMatcher
ClassLoader.private final ElementMatcher<? super JavaModule> moduleMatcher
java.lang.Module.public ForElementMatchers(ElementMatcher<? super TypeDescription> typeMatcher)
AgentBuilder.RawMatcher that only matches the
supplied TypeDescription against a supplied matcher.typeMatcher - The type matcher to apply to a TypeDescription.public ForElementMatchers(ElementMatcher<? super TypeDescription> typeMatcher, ElementMatcher<? super java.lang.ClassLoader> classLoaderMatcher)
AgentBuilder.RawMatcher that only matches the
supplied TypeDescription and its ClassLoader against two matcher in order
to decided if an instrumentation should be conducted.typeMatcher - The type matcher to apply to a TypeDescription.classLoaderMatcher - The class loader matcher to apply to a ClassLoader.public ForElementMatchers(ElementMatcher<? super TypeDescription> typeMatcher, ElementMatcher<? super java.lang.ClassLoader> classLoaderMatcher, ElementMatcher<? super JavaModule> moduleMatcher)
AgentBuilder.RawMatcher that only matches the
supplied TypeDescription, its ClassLoader and module against element
suitable matchers.typeMatcher - The type matcher to apply to a TypeDescription.classLoaderMatcher - The class loader matcher to apply to a ClassLoader.moduleMatcher - A module matcher to apply to a java.lang.Module.public boolean matches(TypeDescription typeDescription, java.lang.ClassLoader classLoader, JavaModule module, java.lang.Class<?> classBeingRedefined, java.security.ProtectionDomain protectionDomain)
typeDescription should be instrumented with the entailed
AgentBuilder.Transformers.matches in interface AgentBuilder.RawMatchertypeDescription - A description of the type to be instrumented.classLoader - The class loader of the instrumented type. Might be null if this class
loader represents the bootstrap class loader.module - The transformed type's module or null if the current VM does not support modules.classBeingRedefined - The class being redefined which is only not null if a retransformation
is applied.protectionDomain - The protection domain of the type being transformed.true if the entailed AgentBuilder.Transformers should
be applied for the given typeDescription.