Class EnhancerImpl
java.lang.Object
org.hibernate.bytecode.enhance.internal.bytebuddy.EnhancerImpl
- All Implemented Interfaces:
Enhancer
-
Field Summary
Modifier and TypeFieldDescriptionprotected final org.hibernate.bytecode.enhance.internal.bytebuddy.ByteBuddyEnhancementContext
-
Constructor Summary
ConstructorDescriptionEnhancerImpl
(EnhancementContext enhancementContext, ByteBuddyState byteBuddyState) Constructs the Enhancer, using the given context.EnhancerImpl
(EnhancementContext enhancementContext, ByteBuddyState byteBuddyState, EnhancerClassLocator classLocator) Expert level constructor, this allows for more control of state and bytecode loading, which allows integrators to optimise for particular contexts of use. -
Method Summary
Modifier and TypeMethodDescriptionvoid
discoverTypes
(String className, byte[] originalBytes) Discovers types prior to enhancement.byte[]
Performs the enhancement.
-
Field Details
-
enhancementContext
protected final org.hibernate.bytecode.enhance.internal.bytebuddy.ByteBuddyEnhancementContext enhancementContext
-
-
Constructor Details
-
EnhancerImpl
Constructs the Enhancer, using the given context.- Parameters:
enhancementContext
- Describes the context in which enhancement will occur so as to give access to contextual/environmental information.byteBuddyState
- refers to the ByteBuddy instance to use
-
EnhancerImpl
public EnhancerImpl(EnhancementContext enhancementContext, ByteBuddyState byteBuddyState, EnhancerClassLocator classLocator) Expert level constructor, this allows for more control of state and bytecode loading, which allows integrators to optimise for particular contexts of use.- Parameters:
enhancementContext
-byteBuddyState
-classLocator
-
-
-
Method Details
-
enhance
Performs the enhancement.- Specified by:
enhance
in interfaceEnhancer
- Parameters:
className
- The name of the class whose bytecode is being enhanced.originalBytes
- The class's original (pre-enhancement) byte code- Returns:
- The enhanced bytecode. Could be the same as the original bytecode if the original was already enhanced or we could not enhance it for some reason.
- Throws:
EnhancementException
- Indicates a problem performing the enhancement
-
discoverTypes
Description copied from interface:Enhancer
Discovers types prior to enhancement. It is possible to invoke this method concurrently.- Specified by:
discoverTypes
in interfaceEnhancer
- Parameters:
className
- The name of the class whose bytecode is being analyzed for type discovery.originalBytes
- The class's original (pre-enhancement) byte code
-