Package org.jrd.agent
Class Transformer
java.lang.Object
org.jrd.agent.Transformer
- All Implemented Interfaces:
ClassFileTransformer
This class represent our transformer for retrieving bytecode.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method allows saving of bytecodecleanOverrides
(Pattern cleanPattern) void
This method denies the bytecode to be saved during transformation.byte[]
Returns bytecode of transformed class.(package private) void
removeOverride
(String clazz) void
Resets the map with results to empty mapvoid
setOverride
(String name, byte[] body) byte[]
transform
(ClassLoader loader, String className, Class<?> clazz, ProtectionDomain domain, byte[] classfileBuffer) 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
-
Field Details
-
allowToSaveBytecode
private boolean allowToSaveBytecode -
results
-
overrides
-
-
Constructor Details
-
Transformer
public Transformer()
-
-
Method Details
-
transform
public byte[] transform(ClassLoader loader, String className, Class<?> clazz, ProtectionDomain domain, byte[] classfileBuffer) throws IllegalClassFormatException - Specified by:
transform
in interfaceClassFileTransformer
- Throws:
IllegalClassFormatException
-
getResult
Returns bytecode of transformed class.- Parameters:
name
- name of class we want to get- Returns:
- bytes of given class
-
setOverride
-
getOverriddenFqns
-
resetLastValidResult
public void resetLastValidResult()Resets the map with results to empty map -
allowToSaveBytecode
public void allowToSaveBytecode()This method allows saving of bytecode -
denyToSaveBytecode
public void denyToSaveBytecode()This method denies the bytecode to be saved during transformation. -
removeOverride
-
cleanOverrides
-