Package net.bytebuddy.dynamic
Class ClassFileLocator.AgentBased.ExtractionClassFileTransformer
- java.lang.Object
-
- net.bytebuddy.dynamic.ClassFileLocator.AgentBased.ExtractionClassFileTransformer
-
- All Implemented Interfaces:
java.lang.instrument.ClassFileTransformer
- Enclosing class:
- ClassFileLocator.AgentBased
protected static class ClassFileLocator.AgentBased.ExtractionClassFileTransformer extends java.lang.Object implements java.lang.instrument.ClassFileTransformer
A non-operational class file transformer that remembers the binary format of a given class.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ExtractionClassFileTransformer(java.lang.ClassLoader classLoader, java.lang.String typeName)
Creates a class file transformer for the purpose of extraction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]
getBinaryRepresentation()
Returns the binary representation of the class file that was looked up.byte[]
transform(java.lang.ClassLoader classLoader, java.lang.String internalName, java.lang.Class<?> redefinedType, java.security.ProtectionDomain protectionDomain, byte[] binaryRepresentation)
-
-
-
Constructor Detail
-
ExtractionClassFileTransformer
protected ExtractionClassFileTransformer(java.lang.ClassLoader classLoader, java.lang.String typeName)
Creates a class file transformer for the purpose of extraction.- Parameters:
classLoader
- The class loader that is expected to have loaded the looked-up a class.typeName
- The name of the type to look up.
-
-
Method Detail
-
transform
public byte[] transform(java.lang.ClassLoader classLoader, java.lang.String internalName, java.lang.Class<?> redefinedType, java.security.ProtectionDomain protectionDomain, byte[] binaryRepresentation)
- Specified by:
transform
in interfacejava.lang.instrument.ClassFileTransformer
-
getBinaryRepresentation
protected byte[] getBinaryRepresentation()
Returns the binary representation of the class file that was looked up. The returned array must never be modified.- Returns:
- The binary representation of the class file or
null
if no such class file could be located.
-
-