public class Transformer extends Object
Constructor and Description |
---|
Transformer() |
Modifier and Type | Method and Description |
---|---|
void |
loadRules(ClassLoader cl) |
void |
loadRules(Collection<? extends ClassLoader> loaders)
Scans the rewrite instructions and prepare to rewrite classes that refer to them
accordingly.
|
byte[] |
transform(String className,
byte[] image)
Deprecated.
|
byte[] |
transform(String className,
byte[] image,
ClassLoader classLoader)
Transforms a class file.
|
public void loadRules(ClassLoader cl) throws IOException
IOException
public void loadRules(Collection<? extends ClassLoader> loaders) throws IOException
The effects of this method is cumulative. The added rules are stored on top of what's already in this transformer. This method is concurrency safe, and can be invoked even when Transformer is already being in use.
IOException
@Deprecated public byte[] transform(String className, byte[] image)
transform(String, byte[], ClassLoader)
className
- Binary name of the class, such as "java.security.KeyStore$Builder$FileBuilder$1"image
- Class file image loaded from the disk.public byte[] transform(String className, byte[] image, ClassLoader classLoader)
className
- Binary name of the class, such as "java.security.KeyStore$Builder$FileBuilder$1"image
- Class file image loaded from the disk.classLoader
- The classloader to use when searching for a common parent of 2 classes (used for generating certain StackFrames)Copyright © 2018. All rights reserved.