public class MultiTransformClassFileTransformer extends Object implements ClassFileTransformer, javassist.Translator
ClassFileTransformer
that applies one or more
ClassTransformer
s to a class before it is loaded.Constructor and Description |
---|
MultiTransformClassFileTransformer(ClassTransformer t1,
ClassTransformer... transformers)
Construct with the given
ClassTransformer s. |
Modifier and Type | Method and Description |
---|---|
void |
onLoad(javassist.ClassPool pool,
String classname) |
void |
start(javassist.ClassPool pool) |
byte[] |
transform(ClassLoader loader,
String className,
Class<?> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer) |
byte[] |
transform(String className,
byte[] classfileBuffer)
Transform the given class.
|
public MultiTransformClassFileTransformer(ClassTransformer t1, ClassTransformer... transformers)
ClassTransformer
s.t1
- the first transformertransformers
- any additional transformerspublic byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException
transform
in interface ClassFileTransformer
IllegalClassFormatException
public byte[] transform(String className, byte[] classfileBuffer)
className
- the name of the classclassfileBuffer
- the class bytespublic void start(javassist.ClassPool pool) throws javassist.NotFoundException, javassist.CannotCompileException
start
in interface javassist.Translator
javassist.NotFoundException
javassist.CannotCompileException