Class ClassFilePostProcessor.ForClassFileTransformer
java.lang.Object
net.bytebuddy.dynamic.loading.ClassFilePostProcessor.ForClassFileTransformer
- All Implemented Interfaces:
ClassFilePostProcessor
- Enclosing interface:
ClassFilePostProcessor
@Enhance
public static class ClassFilePostProcessor.ForClassFileTransformer
extends Object
implements ClassFilePostProcessor
A class file post processor that delegates to an
ClassFileTransformer.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA permission collection that implies all permissions.Nested classes/interfaces inherited from interface ClassFilePostProcessor
ClassFilePostProcessor.ForClassFileTransformer, ClassFilePostProcessor.NoOp -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final ProtectionDomainA protection domain that represents all permissions.private final ClassFileTransformerThe class file transformer to delegate to.private static final Class<?> Indicates that a class is not currently loaded. -
Constructor Summary
ConstructorsConstructorDescriptionForClassFileTransformer(ClassFileTransformer classFileTransformer) Creates a new class file post processor for a class file transformer. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]transform(ClassLoader classLoader, String name, ProtectionDomain protectionDomain, byte[] binaryRepresentation) Transforms a class file for a given class.
-
Field Details
-
ALL_PRIVILEGES
A protection domain that represents all permissions. -
UNLOADED_TYPE
Indicates that a class is not currently loaded. -
classFileTransformer
The class file transformer to delegate to.
-
-
Constructor Details
-
ForClassFileTransformer
Creates a new class file post processor for a class file transformer.- Parameters:
classFileTransformer- The class file transformer to delegate to.
-
-
Method Details
-
transform
public byte[] transform(@MaybeNull ClassLoader classLoader, String name, @MaybeNull ProtectionDomain protectionDomain, byte[] binaryRepresentation) Transforms a class file for a given class.- Specified by:
transformin interfaceClassFilePostProcessor- Parameters:
classLoader- The class loader which is used to load a class ornullif loaded by the bootstrap loader.name- The binary name of the transformed class.protectionDomain- The protection domain of the transformed class ornullif no protection domain is provided.binaryRepresentation- The binary representation of the class file.- Returns:
- The class file to use.
-