org.hibernate.bytecode
Class AbstractClassTransformerImpl
java.lang.Object
org.hibernate.bytecode.AbstractClassTransformerImpl
- All Implemented Interfaces:
- ClassTransformer
- Direct Known Subclasses:
- CglibClassTransformer, JavassistClassTransformer
public abstract class AbstractClassTransformerImpl
- extends Object
- implements ClassTransformer
- Author:
- Emmanuel Bernard, Steve Ebersole
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
classFilter
protected final ClassFilter classFilter
fieldFilter
protected final FieldFilter fieldFilter
AbstractClassTransformerImpl
protected AbstractClassTransformerImpl(ClassFilter classFilter,
FieldFilter fieldFilter)
transform
public byte[] transform(ClassLoader loader,
String className,
Class classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer)
- Description copied from interface:
ClassTransformer
- Invoked when a class is being loaded or redefined to add hooks for persistence bytecode manipulation
- Specified by:
transform
in interface ClassTransformer
- Parameters:
loader
- the defining class loaderof the class being transformed. It may be null if using bootstrap loaderclassName
- The name of the class being transformedclassBeingRedefined
- If an already loaded class is being redefined, then pass this as a parameterprotectionDomain
- ProtectionDomain of the class being (re)-definedclassfileBuffer
- The input byte buffer in class file format
- Returns:
- A well-formed class file that can be loaded
doTransform
protected abstract byte[] doTransform(ClassLoader loader,
String className,
Class classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer)