Package net.bytebuddy.agent.builder
Class AgentBuilder.Default.Transforming
- java.lang.Object
-
- net.bytebuddy.agent.builder.AgentBuilder.Matchable.AbstractBase<T>
-
- net.bytebuddy.agent.builder.AgentBuilder.Default.Delegator<AgentBuilder.Identified.Narrowable>
-
- net.bytebuddy.agent.builder.AgentBuilder.Default.Transforming
-
- All Implemented Interfaces:
AgentBuilder
,AgentBuilder.Identified
,AgentBuilder.Identified.Extendable
,AgentBuilder.Identified.Narrowable
,AgentBuilder.Matchable<AgentBuilder.Identified.Narrowable>
- Enclosing class:
- AgentBuilder.Default
@Enhance(includeSyntheticFields=true) protected class AgentBuilder.Default.Transforming extends AgentBuilder.Default.Delegator<AgentBuilder.Identified.Narrowable> implements AgentBuilder.Identified.Extendable, AgentBuilder.Identified.Narrowable
A helper class that describes aAgentBuilder.Default
after supplying aAgentBuilder.RawMatcher
such that one or severalAgentBuilder.Transformer
s can be supplied.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder
AgentBuilder.CircularityLock, AgentBuilder.ClassFileBufferStrategy, AgentBuilder.Default, AgentBuilder.DescriptionStrategy, AgentBuilder.FallbackStrategy, AgentBuilder.Identified, AgentBuilder.Ignored, AgentBuilder.InitializationStrategy, AgentBuilder.InjectionStrategy, AgentBuilder.InstallationListener, AgentBuilder.LambdaInstrumentationStrategy, AgentBuilder.Listener, AgentBuilder.LocationStrategy, AgentBuilder.Matchable<T extends AgentBuilder.Matchable<T>>, AgentBuilder.PoolStrategy, AgentBuilder.RawMatcher, AgentBuilder.RedefinitionListenable, AgentBuilder.RedefinitionStrategy, AgentBuilder.Transformer, AgentBuilder.TransformerDecorator, AgentBuilder.TypeStrategy
-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder.Identified
AgentBuilder.Identified.Extendable, AgentBuilder.Identified.Narrowable
-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder.Matchable
AgentBuilder.Matchable.AbstractBase<S extends AgentBuilder.Matchable<S>>
-
-
Field Summary
Fields Modifier and Type Field Description private AgentBuilder.RawMatcher
rawMatcher
The supplied raw matcher.private boolean
terminal
true
if this transformer is a terminal transformation.private java.util.List<AgentBuilder.Transformer>
transformers
The supplied transformer.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Transforming(AgentBuilder.RawMatcher rawMatcher, java.util.List<AgentBuilder.Transformer> transformers, boolean terminal)
Creates a new matched default agent builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AgentBuilder.Identified.Narrowable
and(AgentBuilder.RawMatcher rawMatcher)
Defines a matching that is positive if both the previous matcher and the supplied matcher are matched.AgentBuilder
asTerminalTransformation()
Applies the previously defined transformation as terminal such that no subsequent transformers are applied even if their matchers would include the type that was matched for applying this transformer.protected AgentBuilder
materialize()
Materializes the currently describedAgentBuilder
.AgentBuilder.Identified.Narrowable
or(AgentBuilder.RawMatcher rawMatcher)
Defines a matching that is positive if the previous matcher or the supplied matcher are matched.AgentBuilder.Identified.Extendable
transform(AgentBuilder.Transformer transformer)
Applies the given transformer for the already supplied matcher.-
Methods inherited from class net.bytebuddy.agent.builder.AgentBuilder.Default.Delegator
assureReadEdgeFromAndTo, assureReadEdgeFromAndTo, assureReadEdgeFromAndTo, assureReadEdgeTo, assureReadEdgeTo, assureReadEdgeTo, disableClassFormatChanges, disableNativeMethodPrefix, enableNativeMethodPrefix, ignore, ignore, ignore, ignore, installOn, installOnByteBuddyAgent, makeRaw, patchOn, patchOnByteBuddyAgent, type, type, type, type, with, with, with, with, with, with, with, with, with, with, with, with, with, with, with
-
Methods inherited from class net.bytebuddy.agent.builder.AgentBuilder.Matchable.AbstractBase
and, and, and, or, or, or
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.bytebuddy.agent.builder.AgentBuilder
assureReadEdgeFromAndTo, assureReadEdgeFromAndTo, assureReadEdgeFromAndTo, assureReadEdgeTo, assureReadEdgeTo, assureReadEdgeTo, disableClassFormatChanges, disableNativeMethodPrefix, enableNativeMethodPrefix, ignore, ignore, ignore, ignore, installOn, installOnByteBuddyAgent, makeRaw, patchOn, patchOnByteBuddyAgent, type, type, type, type, with, with, with, with, with, with, with, with, with, with, with, with, with, with, with
-
-
-
-
Field Detail
-
rawMatcher
private final AgentBuilder.RawMatcher rawMatcher
The supplied raw matcher.
-
transformers
private final java.util.List<AgentBuilder.Transformer> transformers
The supplied transformer.
-
terminal
private final boolean terminal
true
if this transformer is a terminal transformation.
-
-
Constructor Detail
-
Transforming
protected Transforming(AgentBuilder.RawMatcher rawMatcher, java.util.List<AgentBuilder.Transformer> transformers, boolean terminal)
Creates a new matched default agent builder.- Parameters:
rawMatcher
- The supplied raw matcher.transformers
- The transformers to apply.terminal
-true
if this transformer is a terminal transformation.
-
-
Method Detail
-
materialize
protected AgentBuilder materialize()
Description copied from class:AgentBuilder.Default.Delegator
Materializes the currently describedAgentBuilder
.- Specified by:
materialize
in classAgentBuilder.Default.Delegator<AgentBuilder.Identified.Narrowable>
- Returns:
- An agent builder that represents the currently described entry of this instance.
-
transform
public AgentBuilder.Identified.Extendable transform(AgentBuilder.Transformer transformer)
Applies the given transformer for the already supplied matcher.- Specified by:
transform
in interfaceAgentBuilder.Identified
- Parameters:
transformer
- The transformer to apply.- Returns:
- A new instance of this agent builder with the transformer being applied when the previously supplied matcher identified a type for instrumentation which also allows for the registration of subsequent transformers.
-
asTerminalTransformation
public AgentBuilder asTerminalTransformation()
Applies the previously defined transformation as terminal such that no subsequent transformers are applied even if their matchers would include the type that was matched for applying this transformer. If this option is not set, subsequent transformations are applied after this transformation such that it is possible that they override non-additive type transformations.- Specified by:
asTerminalTransformation
in interfaceAgentBuilder.Identified.Extendable
- Returns:
- A new agent builder that applies the previously configured transformer terminally.
-
and
public AgentBuilder.Identified.Narrowable and(AgentBuilder.RawMatcher rawMatcher)
Defines a matching that is positive if both the previous matcher and the supplied matcher are matched.- Specified by:
and
in interfaceAgentBuilder.Matchable<AgentBuilder.Identified.Narrowable>
- Parameters:
rawMatcher
- A raw matcher for the type being matched.- Returns:
- A chained matcher.
-
or
public AgentBuilder.Identified.Narrowable or(AgentBuilder.RawMatcher rawMatcher)
Defines a matching that is positive if the previous matcher or the supplied matcher are matched.- Specified by:
or
in interfaceAgentBuilder.Matchable<AgentBuilder.Identified.Narrowable>
- Parameters:
rawMatcher
- A raw matcher for the type being matched.- Returns:
- A chained matcher.
-
-