Class ModelTypePool
java.lang.Object
net.bytebuddy.pool.TypePool.AbstractBase
net.bytebuddy.pool.TypePool.AbstractBase.Hierarchical
net.bytebuddy.pool.TypePool.Default
org.hibernate.bytecode.enhance.internal.bytebuddy.ModelTypePool
- All Implemented Interfaces:
net.bytebuddy.pool.TypePool,EnhancerClassLocator
public class ModelTypePool
extends net.bytebuddy.pool.TypePool.Default
implements EnhancerClassLocator
A TypePool suitable for loading user's classes,
potentially in parallel operations.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.bytebuddy.pool.TypePool.Default
net.bytebuddy.pool.TypePool.Default.AnnotationRegistrant, net.bytebuddy.pool.TypePool.Default.ComponentTypeLocator, net.bytebuddy.pool.TypePool.Default.GenericTypeExtractor, net.bytebuddy.pool.TypePool.Default.GenericTypeRegistrant, net.bytebuddy.pool.TypePool.Default.LazyTypeDescription, net.bytebuddy.pool.TypePool.Default.ParameterBag, net.bytebuddy.pool.TypePool.Default.ReaderMode, net.bytebuddy.pool.TypePool.Default.TypeExtractor, net.bytebuddy.pool.TypePool.Default.WithLazyResolutionNested classes/interfaces inherited from class net.bytebuddy.pool.TypePool.AbstractBase
net.bytebuddy.pool.TypePool.AbstractBase.ArrayTypeResolution, net.bytebuddy.pool.TypePool.AbstractBase.ComponentTypeReference, net.bytebuddy.pool.TypePool.AbstractBase.HierarchicalNested classes/interfaces inherited from interface net.bytebuddy.pool.TypePool
net.bytebuddy.pool.TypePool.AbstractBase, net.bytebuddy.pool.TypePool.CacheProvider, net.bytebuddy.pool.TypePool.ClassLoading, net.bytebuddy.pool.TypePool.Default, net.bytebuddy.pool.TypePool.Empty, net.bytebuddy.pool.TypePool.Explicit, net.bytebuddy.pool.TypePool.LazyFacade, net.bytebuddy.pool.TypePool.Resolution -
Field Summary
Fields inherited from class net.bytebuddy.pool.TypePool.Default
classFileLocator, readerModeFields inherited from class net.bytebuddy.pool.TypePool.AbstractBase
cacheProvider, PRIMITIVE_DESCRIPTORS, PRIMITIVE_TYPES -
Method Summary
Modifier and TypeMethodDescriptionnet.bytebuddy.dynamic.ClassFileLocatorstatic EnhancerClassLocatorbuildModelTypePool(ClassLoader classLoader) Creates a new empty EnhancerClassLocator instance which will load any application classes that need being reflected on from the ClassLoader passed as parameter.static EnhancerClassLocatorbuildModelTypePool(net.bytebuddy.dynamic.ClassFileLocator classFileLocator) Similar tobuildModelTypePool(ClassLoader)except the application classes are not necessarily sourced from a standard classloader: it accepts aClassFileLocator, which offers some more flexibility.static EnhancerClassLocatorbuildModelTypePool(net.bytebuddy.dynamic.ClassFileLocator classFileLocator, CoreTypePool coreTypePool) Similar tobuildModelTypePool(ClassFileLocator)but allows specifying an existingCoreTypePoolto be used as parent pool.static EnhancerClassLocatorbuildModelTypePool(net.bytebuddy.dynamic.ClassFileLocator classFileLocator, CoreTypePool coreTypePool, net.bytebuddy.pool.TypePool.CacheProvider cacheProvider) The more advanced strategy to construct a new ModelTypePool, allowing customization of all its aspects.voidderegisterClassNameAndBytes(String className) This can optionally be used to remove an explicit mapping when it's no longer essential to retain it.protected net.bytebuddy.pool.TypePool.ResolutiondoDescribe(String name) voidregisterClassNameAndBytes(String className, byte[] bytes) Register a new class to the locator explicitly.Methods inherited from class net.bytebuddy.pool.TypePool.Default
equals, hashCode, of, of, ofBootLoader, ofPlatformLoader, ofSystemLoaderMethods inherited from class net.bytebuddy.pool.TypePool.AbstractBase.Hierarchical
clear, describeMethods inherited from class net.bytebuddy.pool.TypePool.AbstractBase
doCacheMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.bytebuddy.pool.TypePool
clear, describe
-
Method Details
-
buildModelTypePool
Creates a new empty EnhancerClassLocator instance which will load any application classes that need being reflected on from the ClassLoader passed as parameter. This TypePool will delegate, parent first, to a newly constructed empty instance of CoreTypePool; this parent pool will be used to load non-application types from the Hibernate classloader instead, not the one specified as argument.- Parameters:
classLoader-- Returns:
- the newly created EnhancerClassLocator
- See Also:
-
buildModelTypePool
public static EnhancerClassLocator buildModelTypePool(net.bytebuddy.dynamic.ClassFileLocator classFileLocator) Similar tobuildModelTypePool(ClassLoader)except the application classes are not necessarily sourced from a standard classloader: it accepts aClassFileLocator, which offers some more flexibility.- Parameters:
classFileLocator-- Returns:
- the newly created EnhancerClassLocator
-
buildModelTypePool
public static EnhancerClassLocator buildModelTypePool(net.bytebuddy.dynamic.ClassFileLocator classFileLocator, CoreTypePool coreTypePool) Similar tobuildModelTypePool(ClassFileLocator)but allows specifying an existingCoreTypePoolto be used as parent pool. This forms allows constructing a custom CoreTypePool and also separated the cache of the parent pool, which might be useful to reuse for multiple enhancement processes while desiring a clean new state for theModelTypePool.- Parameters:
classFileLocator-coreTypePool-- Returns:
-
buildModelTypePool
public static EnhancerClassLocator buildModelTypePool(net.bytebuddy.dynamic.ClassFileLocator classFileLocator, CoreTypePool coreTypePool, net.bytebuddy.pool.TypePool.CacheProvider cacheProvider) The more advanced strategy to construct a new ModelTypePool, allowing customization of all its aspects.- Parameters:
classFileLocator-coreTypePool-cacheProvider-- Returns:
-
doDescribe
- Overrides:
doDescribein classnet.bytebuddy.pool.TypePool.Default
-
registerClassNameAndBytes
Description copied from interface:EnhancerClassLocatorRegister a new class to the locator explicitly.- Specified by:
registerClassNameAndBytesin interfaceEnhancerClassLocator
-
deregisterClassNameAndBytes
Description copied from interface:EnhancerClassLocatorThis can optionally be used to remove an explicit mapping when it's no longer essential to retain it. The underlying implementation might ignore the operation.- Specified by:
deregisterClassNameAndBytesin interfaceEnhancerClassLocator
-
asClassFileLocator
public net.bytebuddy.dynamic.ClassFileLocator asClassFileLocator()- Specified by:
asClassFileLocatorin interfaceEnhancerClassLocator- Returns:
- the underlying
ClassFileLocator
-