Top Description Fields Constructors Methods
org.springframework.orm.jpa.persistenceunit

pack-priv Class ClassFileTransformerAdapter

extends Object
implements ClassFileTransformer
Class Inheritance
All Implemented Interfaces
java.lang.instrument.ClassFileTransformer
Imports
java.lang.instrument.ClassFileTransformer, java.security.ProtectionDomain, jakarta.persistence.spi.ClassTransformer, org.apache.commons.logging.Log, .LogFactory, org.springframework.lang.Nullable, org.springframework.util.Assert

Simple adapter that implements the java.lang.instrument.ClassFileTransformer interface based on a JPA ClassTransformer which a JPA PersistenceProvider asks the PersistenceUnitInfo to install in the current runtime.
Authors
Rod Johnson, Juergen Hoeller
Since
2.0
See Also
jakarta.persistence.spi.PersistenceUnitInfo#addTransformer(jakarta.persistence.spi.ClassTransformer)

Field Summary

Modifier and TypeField and Description
private final ClassTransformer
private boolean
private static final Log

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public byte[]
transform(ClassLoader
the defining loader of the class to be transformed, may be null if the bootstrap loader
loader
,
String
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".
className
,
Class<?>
if this is triggered by a redefine or retransform, the class being redefined or retransformed; if this is a class load, null
classBeingRedefined
,
ProtectionDomain
the protection domain of the class being defined or redefined
protectionDomain
,
byte[]
the input byte buffer in class file format - must not be modified
classfileBuffer
)

Overrides default java.lang.instrument.ClassFileTransformer.transform.

Transforms the given class file and returns a new replacement class file.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

classTransformerback to summary
private final ClassTransformer classTransformer
currentlyTransformingback to summary
private boolean currentlyTransforming
loggerback to summary
private static final Log logger

Constructor Detail

ClassFileTransformerAdapterback to summary
public ClassFileTransformerAdapter(ClassTransformer classTransformer)

Method Detail

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
transformback to summary
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)

Overrides default java.lang.instrument.ClassFileTransformer.transform.

Doc from java.lang.instrument.ClassFileTransformer.transform.

Transforms the given class file and returns a new replacement class file. This method is invoked when the Module bearing transform is not overridden.

Parameters
loader:ClassLoader

the defining loader of the class to be transformed, may be null if the bootstrap loader

className:String

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:Class<?>

if this is triggered by a redefine or retransform, the class being redefined or retransformed; if this is a class load, null

protectionDomain:ProtectionDomain

the protection domain of the class being defined or redefined

classfileBuffer:byte[]

the input byte buffer in class file format - must not be modified

Returns:byte[]

a well-formed class file buffer (the result of the transform), or null if no transform is performed

Annotations
@Override
@Nullable