java.lang.instrument
public interface ClassFileTransformer
Since: 1.5
See Also: Instrumentation addTransformer removeTransformer
Method Summary | |
---|---|
byte[] | transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)
Implementation of this method transforms a class by redefining its
bytecodes. |
ClassLoader.defineClass
) or redefined
(Instrumentation.redefineClasses
)Parameters: loader the loader of the class className the name of the class with packages separated with "/" classBeingRedefined the class being redefined if it's the case, null otherwise protectionDomain the protection domain of the class being defined or redefined classfileBuffer the input byte buffer in class file format
Returns: a class file buffer or null when no transformation has been performed
Throws: IllegalClassFormatException if the byte buffer does not represent a well-formed class file
See Also: (java.lang.instrument.ClassDefinition[])