Class 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.WithLazyResolution
      • Nested 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.Hierarchical
      • Nested 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, classReaderFactory, readerMode
      • Fields inherited from class net.bytebuddy.pool.TypePool.AbstractBase

        cacheProvider, PRIMITIVE_DESCRIPTORS, PRIMITIVE_TYPES
    • Method Detail

      • buildModelTypePool

        public static EnhancerClassLocator buildModelTypePool​(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. 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:
        CoreTypePool
      • buildModelTypePool

        public static EnhancerClassLocator buildModelTypePool​(net.bytebuddy.dynamic.ClassFileLocator classFileLocator)
        Similar to buildModelTypePool(ClassLoader) except the application classes are not necessarily sourced from a standard classloader: it accepts a ClassFileLocator, 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 to buildModelTypePool(ClassFileLocator) but allows specifying an existing CoreTypePool to 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 the ModelTypePool.
        Parameters:
        classFileLocator -
        coreTypePool -
        Returns:
      • deregisterClassNameAndBytes

        public void deregisterClassNameAndBytes​(String className)
        Description copied from interface: EnhancerClassLocator
        This 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:
        deregisterClassNameAndBytes in interface EnhancerClassLocator
      • asClassFileLocator

        public net.bytebuddy.dynamic.ClassFileLocator asClassFileLocator()
        Specified by:
        asClassFileLocator in interface EnhancerClassLocator
        Returns:
        the underlying ClassFileLocator