public interface ClassFileTransformer
| Modifier and Type | Method and Description |
|---|---|
byte[] |
transform(java.lang.ClassLoader loader,
java.lang.String className,
java.lang.Class<?> classBeingRedefined,
java.security.ProtectionDomain protectionDomain,
byte[] classfileBuffer)
Implementation of this method transforms a class by redefining its
bytecodes.
|
byte[] transform(java.lang.ClassLoader loader, java.lang.String className, java.lang.Class<?> classBeingRedefined, java.security.ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException
ClassLoader.defineClass) or redefined
(Instrumentation.redefineClasses)loader - the loader of the classclassName - the name of the class with packages separated with "/"classBeingRedefined - the class being redefined if it's the case,
null otherwiseprotectionDomain - the protection domain of the class being defined or
redefinedclassfileBuffer - the input byte buffer in class file formatIllegalClassFormatException - if the byte buffer does not represent
a well-formed class fileInstrumentation.redefineClasses(java.lang.instrument.ClassDefinition[])