Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.weaving

public Class PersistenceWeaver

extends Object
implements ClassTransformer
Class Inheritance
All Implemented Interfaces
jakarta.persistence.spi.ClassTransformer
Imports
java.security.ProtectionDomain, java.util.Map, jakarta.persistence.spi.ClassTransformer, .TransformerException, org.eclipse.persistence.config.SystemProperties, org.eclipse.persistence.internal.helper.Helper, org.eclipse.persistence.asm.ASMFactory, .ClassReader, .ClassVisitor, .ClassWriter, .EclipseLinkClassReader, org.eclipse.persistence.internal.localization.ExceptionLocalization, org.eclipse.persistence.internal.security.PrivilegedAccessHelper, org.eclipse.persistence.logging.AbstractSessionLog, .SessionLog, .SessionLogEntry

INTERNAL: This class performs dynamic byte code weaving: for each attribute mapped with One To One mapping with Basic Indirection it substitutes the original attribute's type for ValueHolderInterface.

Field Summary

Modifier and TypeField and Description
protected Map<String, ClassDetails>
classDetailsMap

Class name in JVM '/' format to ClassDetails map.

Constructor Summary

AccessConstructor and Description
public
PersistenceWeaver(final Map<String, ClassDetails>
Class name to ClassDetails map.
classDetailsMap
)

INTERNAL: Creates an instance of dynamic byte code weaver.

Method Summary

Modifier and TypeMethod and Description
public void
clear()

INTERNAL: Allow the weaver to be clear to release its referenced memory.

public Map<String, ClassDetails>

Returns:

Class name in JVM '/' format to ClassDetails map.
getClassDetailsMap
()

INTERNAL: Get Class name in JVM '/' format to ClassDetails map.

protected static String

Returns:

Unqualified class name.
getShortName
(String
Class name with '/' as delimiter.
name
)

INTERNAL: Returns an unqualified class name from the specified class name.

public byte[]

Returns:

A well-formed class file buffer (the result of the transform), or null if no transform is performed.
transform
(final ClassLoader
The defining loader of the class to be transformed, may be null if the bootstrap loader.
loader
,
final String
The name of the class in the internal form of fully qualified class and interface names.
className
,
final Class<?>
If this is a redefine, the class being redefined, otherwise null.
classBeingRedefined
,
final ProtectionDomain
The protection domain of the class being defined or redefined.
protectionDomain
,
final byte[]
The input byte buffer in class file format (must not be modified).
classfileBuffer
)

Implements jakarta.persistence.spi.ClassTransformer.transform.

INTERNAL: Perform dynamic byte code weaving of class.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classDetailsMapback to summary
protected Map<String, ClassDetails> classDetailsMap

Class name in JVM '/' format to ClassDetails map.

Constructor Detail

PersistenceWeaverback to summary
public PersistenceWeaver(final Map<String, ClassDetails> classDetailsMap)

INTERNAL: Creates an instance of dynamic byte code weaver.

Parameters
classDetailsMap:Map<String, ClassDetails>

Class name to ClassDetails map.

Since
2.7

Method Detail

clearback to summary
public void clear()

INTERNAL: Allow the weaver to be clear to release its referenced memory. This is required because the class loader reference to the transformer will never gc.

getClassDetailsMapback to summary
public Map<String, ClassDetails> getClassDetailsMap()

INTERNAL: Get Class name in JVM '/' format to ClassDetails map.

Returns:Map<String, ClassDetails>

Class name in JVM '/' format to ClassDetails map.

getShortNameback to summary
protected static String getShortName(String name)

INTERNAL: Returns an unqualified class name from the specified class name.

Parameters
name:String

Class name with '/' as delimiter.

Returns:String

Unqualified class name.

transformback to summary
public byte[] transform(final ClassLoader loader, final String className, final Class<?> classBeingRedefined, final ProtectionDomain protectionDomain, final byte[] classfileBuffer) throws TransformerException

Implements jakarta.persistence.spi.ClassTransformer.transform.

INTERNAL: Perform dynamic byte code weaving of class.

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.

classBeingRedefined:Class<?>

If this is a redefine, the class being redefined, otherwise 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
Exceptions
TransformerException:

Doc from jakarta.persistence.spi.ClassTransformer.transform.

if the input does not represent a well-formed class file