Package net.bytebuddy.agent.builder
Class AgentBuilder.Default.NativeMethodStrategy.ForPrefix
- java.lang.Object
-
- net.bytebuddy.agent.builder.AgentBuilder.Default.NativeMethodStrategy.ForPrefix
-
- All Implemented Interfaces:
AgentBuilder.Default.NativeMethodStrategy
- Enclosing interface:
- AgentBuilder.Default.NativeMethodStrategy
@Enhance public static class AgentBuilder.Default.NativeMethodStrategy.ForPrefix extends java.lang.Object implements AgentBuilder.Default.NativeMethodStrategy
A native method strategy that prefixes method names with a fixed value for supporting rebasing of native methods.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder.Default.NativeMethodStrategy
AgentBuilder.Default.NativeMethodStrategy.Disabled, AgentBuilder.Default.NativeMethodStrategy.ForPrefix
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
prefix
The method name prefix.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForPrefix(java.lang.String prefix)
Creates a new name prefixing native method strategy.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(java.lang.instrument.Instrumentation instrumentation, java.lang.instrument.ClassFileTransformer classFileTransformer)
Applies this native method strategy.protected static AgentBuilder.Default.NativeMethodStrategy
of(java.lang.String prefix)
Creates a new native method strategy for prefixing method names.MethodNameTransformer
resolve()
Resolves the method name transformer for this strategy.
-
-
-
Method Detail
-
of
protected static AgentBuilder.Default.NativeMethodStrategy of(java.lang.String prefix)
Creates a new native method strategy for prefixing method names.- Parameters:
prefix
- The method name prefix.- Returns:
- An appropriate native method strategy.
-
resolve
public MethodNameTransformer resolve()
Resolves the method name transformer for this strategy.- Specified by:
resolve
in interfaceAgentBuilder.Default.NativeMethodStrategy
- Returns:
- A method name transformer for this strategy.
-
apply
public void apply(java.lang.instrument.Instrumentation instrumentation, java.lang.instrument.ClassFileTransformer classFileTransformer)
Applies this native method strategy.- Specified by:
apply
in interfaceAgentBuilder.Default.NativeMethodStrategy
- Parameters:
instrumentation
- The instrumentation to apply this strategy upon.classFileTransformer
- The class file transformer being registered.
-
-