JLIClassTransformer
public interface ClassTransformer
Modifier and Type | Field | Description |
---|---|---|
static ClassTransformer |
IDENTITY |
The identity transformation, which does not modify the class bytes at all.
|
Modifier and Type | Method | Description |
---|---|---|
static ClassTransformer |
allOf(java.util.Collection<? extends ClassTransformer> transformers) |
Get a new transformer which applies all the transformations in the given collection.
|
default ClassTransformer |
andThen(ClassTransformer other) |
Get a new transformer which applies this transformation followed by another transformation.
|
java.nio.ByteBuffer |
transform(java.lang.ClassLoader loader,
java.lang.String className,
java.security.ProtectionDomain protectionDomain,
java.nio.ByteBuffer classBytes) |
Transform the bytes of a class.
|
static final ClassTransformer IDENTITY
java.nio.ByteBuffer transform(java.lang.ClassLoader loader, java.lang.String className, java.security.ProtectionDomain protectionDomain, java.nio.ByteBuffer classBytes) throws java.lang.IllegalArgumentException
loader
- the class loader of the class being transformedclassName
- the internal name of the class being transformed (not null
)protectionDomain
- the protection domain of the class, if anyclassBytes
- the class bytes being transformed (not null
; may be a direct or heap buffer)java.lang.IllegalArgumentException
- if the class could not be transformed for some reasondefault ClassTransformer andThen(ClassTransformer other)
other
- the other transformation (must not be null
)null
)static ClassTransformer allOf(java.util.Collection<? extends ClassTransformer> transformers)
transformers
- the transformer collection (must not be null
)null
)Copyright © 2022 JBoss by Red Hat. All rights reserved.