Class InstructionTransformer
java.lang.Object
de.uzl.its.swat.instrument.instruction.InstructionTransformer
- All Implemented Interfaces:
ClassFileTransformer
An agent provides an implementation of this interface in order to transform class files. The
transformation occurs before the class is defined by the JVM.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic PrintBox
byte[]
transform
(ClassLoader loader, String cname, Class<?> classBeingRedefined, ProtectionDomain d, byte[] cbuf) The implementation of this method may transform the supplied class file and return a new replacement class file.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.instrument.ClassFileTransformer
transform
-
Constructor Details
-
InstructionTransformer
public InstructionTransformer()
-
-
Method Details
-
transform
public byte[] transform(ClassLoader loader, String cname, Class<?> classBeingRedefined, ProtectionDomain d, byte[] cbuf) The implementation of this method may transform the supplied class file and return a new replacement class file. Addition: Adds the InstructionClassAdapter for modifying the classFile- Specified by:
transform
in interfaceClassFileTransformer
- Parameters:
loader
- the defining loader of the class to be transformed, may be null if the bootstrap loadercname
- the name of the class in the internal form of fully qualified class and interface names as defined in The Java Virtual Machine Specification. For example, "java/util/List".classBeingRedefined
- if this is triggered by a redefine or retransform, the class being redefined or retransformed; if this is a class load, nulld
- the protection domain of the class being defined or redefinedcbuf
- the input byte buffer in class file format - must not be modified- Returns:
- a well-formed class file buffer (the result of the transform), or null if no transform is performed.
-
getPrintBox
-