public class Transformer extends Object implements ClassFileTransformer
Constructor and Description |
---|
Transformer() |
Modifier and Type | Method and Description |
---|---|
void |
allowToSaveBytecode()
This method allows saving of bytecode
|
void |
denyToSaveBytecode()
This method denies the bytecode to be saved during transformation.
|
byte[] |
getResult(String name)
Returns bytecode of transformed class.
|
void |
resetLastValidResult()
Resets the map with results to empty map
|
void |
resetOverrides() |
void |
setOverride(String name,
byte[] body) |
byte[] |
transform(ClassLoader loader,
String className,
Class<?> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer) |
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException
transform
in interface ClassFileTransformer
IllegalClassFormatException
public byte[] getResult(String name)
name
- name of class we want to getpublic void setOverride(String name, byte[] body)
public void resetLastValidResult()
public void resetOverrides()
public void allowToSaveBytecode()
public void denyToSaveBytecode()
Copyright © 2019. All rights reserved.