public class WeavingTransformer
extends java.lang.Object
Note: This class is deliberately implemented for minimal external dependencies, since it is included in weaver jars (to be deployed into application servers).
Constructor and Description |
---|
WeavingTransformer(java.lang.ClassLoader classLoader)
Create a new WeavingTransformer for the given class loader.
|
Modifier and Type | Method and Description |
---|---|
void |
addTransformer(java.lang.instrument.ClassFileTransformer transformer)
Add a class file transformer to be applied by this weaver.
|
byte[] |
transformIfNecessary(java.lang.String className,
byte[] bytes)
Apply transformation on a given class byte definition.
|
byte[] |
transformIfNecessary(java.lang.String className,
java.lang.String internalName,
byte[] bytes,
java.security.ProtectionDomain pd)
Apply transformation on a given class byte definition.
|
public WeavingTransformer(@Nullable java.lang.ClassLoader classLoader)
classLoader
- the ClassLoader to build a transformer forpublic void addTransformer(java.lang.instrument.ClassFileTransformer transformer)
transformer
- the class file transformer to registerpublic byte[] transformIfNecessary(java.lang.String className, byte[] bytes)
className
- the full qualified name of the class in dot format (i.e. some.package.SomeClass)bytes
- class byte definitionpublic byte[] transformIfNecessary(java.lang.String className, java.lang.String internalName, byte[] bytes, @Nullable java.security.ProtectionDomain pd)
className
- the full qualified name of the class in dot format (i.e. some.package.SomeClass)internalName
- class name internal name in / format (i.e. some/package/SomeClass)bytes
- class byte definitionpd
- protection domain to be used (can be null)