Class TypePool.Default
java.lang.Object
net.bytebuddy.pool.TypePool.AbstractBase
net.bytebuddy.pool.TypePool.AbstractBase.Hierarchical
net.bytebuddy.pool.TypePool.Default
- All Implemented Interfaces:
TypePool
- Direct Known Subclasses:
TypePool.Default.WithLazyResolution
- Enclosing interface:
TypePool
A default implementation of a TypePool that models binary data in the Java byte code format
into a TypeDescription. The data lookup is delegated to a ClassFileLocator.
TypePool.Resolutions that are produced by this type pool are either fully resolved or not resolved at all.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceAn annotation registrant implements a visitor pattern for reading an unknown amount of values of annotations.protected static interfaceA component type locator allows for the lazy location of an array's component type.protected static classA generic type extractor allows for an iterative extraction of generic type information.protected static interfaceA type registrant allows to register a generic type token.protected static classA type description that looks up any referencedByteCodeElementorAnnotationDescriptionby querying a type pool at lookup time.protected static classA bag for collecting parameter meta information that is stored as debug information for implemented methods.static enumDetermines the granularity of the class file parsing that is conducted by aTypePool.Default.protected classA type extractor reads a class file and collects data that is relevant to create a type description.static classA variant ofTypePool.Defaultthat resolves type descriptions lazily.Nested classes/interfaces inherited from class TypePool.AbstractBase
TypePool.AbstractBase.ArrayTypeResolution, TypePool.AbstractBase.ComponentTypeReference, TypePool.AbstractBase.HierarchicalNested classes/interfaces inherited from interface TypePool
TypePool.AbstractBase, TypePool.CacheProvider, TypePool.ClassLoading, TypePool.Default, TypePool.Empty, TypePool.Explicit, TypePool.LazyFacade, TypePool.Resolution -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ClassFileLocatorThe locator to query for finding binary data of a type.protected final AsmClassReader.FactoryThe class reader factory to use.private static final org.objectweb.asm.MethodVisitorIndicates that a visited method should be ignored.protected final TypePool.Default.ReaderModeThe reader mode to apply by this default type pool.Fields inherited from class TypePool.AbstractBase
cacheProvider, PRIMITIVE_DESCRIPTORS, PRIMITIVE_TYPES -
Constructor Summary
ConstructorsConstructorDescriptionDefault(TypePool.CacheProvider cacheProvider, ClassFileLocator classFileLocator, TypePool.Default.ReaderMode readerMode) Creates a new default type pool without a parent pool.Default(TypePool.CacheProvider cacheProvider, ClassFileLocator classFileLocator, TypePool.Default.ReaderMode readerMode, TypePool parentPool) Creates a new default type pool.Default(TypePool.CacheProvider cacheProvider, ClassFileLocator classFileLocator, TypePool.Default.ReaderMode readerMode, AsmClassReader.Factory classReaderFactory) Creates a new default type pool that uses an explicit class reader factory.Default(TypePool.CacheProvider cacheProvider, ClassFileLocator classFileLocator, TypePool.Default.ReaderMode readerMode, AsmClassReader.Factory classReaderFactory, TypePool parentPool) Creates a new default type pool. -
Method Summary
Modifier and TypeMethodDescriptionprotected TypePool.ResolutiondoDescribe(String name) Determines a resolution to a non-primitive, non-array type.protected TypeDescriptiondoParse(AsmClassReader classReader) Parses the supplied binary representation and returns a corresponding type description.static TypePoolof(ClassLoader classLoader) Returns a type pool for the provided class loader.static TypePoolof(ClassFileLocator classFileLocator) Creates a defaultTypePoolthat looks up data by querying the supplied class file locator.static TypePoolCreates a defaultTypePoolthat looks up data by querying the boot class loader.static TypePoolCreates a defaultTypePoolthat looks up data by querying the plaform class loader.static TypePoolCreates a defaultTypePoolthat looks up data by querying the system class loader.Methods inherited from class TypePool.AbstractBase.Hierarchical
clear, describeMethods inherited from class TypePool.AbstractBase
doCache
-
Field Details
-
IGNORE_METHOD
Indicates that a visited method should be ignored. -
classFileLocator
The locator to query for finding binary data of a type. -
readerMode
The reader mode to apply by this default type pool. -
classReaderFactory
The class reader factory to use.
-
-
Constructor Details
-
Default
public Default(TypePool.CacheProvider cacheProvider, ClassFileLocator classFileLocator, TypePool.Default.ReaderMode readerMode) Creates a new default type pool without a parent pool.- Parameters:
cacheProvider- The cache provider to be used.classFileLocator- The class file locator to be used.readerMode- The reader mode to apply by this default type pool.
-
Default
public Default(TypePool.CacheProvider cacheProvider, ClassFileLocator classFileLocator, TypePool.Default.ReaderMode readerMode, TypePool parentPool) Creates a new default type pool.- Parameters:
cacheProvider- The cache provider to be used.classFileLocator- The class file locator to be used.readerMode- The reader mode to apply by this default type pool.parentPool- The parent type pool.
-
Default
public Default(TypePool.CacheProvider cacheProvider, ClassFileLocator classFileLocator, TypePool.Default.ReaderMode readerMode, AsmClassReader.Factory classReaderFactory) Creates a new default type pool that uses an explicit class reader factory.- Parameters:
cacheProvider- The cache provider to be used.classFileLocator- The class file locator to be used.readerMode- The reader mode to apply by this default type pool.classReaderFactory- The class reader factory to use.
-
Default
public Default(TypePool.CacheProvider cacheProvider, ClassFileLocator classFileLocator, TypePool.Default.ReaderMode readerMode, AsmClassReader.Factory classReaderFactory, TypePool parentPool) Creates a new default type pool.- Parameters:
cacheProvider- The cache provider to be used.classFileLocator- The class file locator to be used.readerMode- The reader mode to apply by this default type pool.classReaderFactory- The class reader factory to use.parentPool- The parent type pool.
-
-
Method Details
-
ofSystemLoader
-
ofPlatformLoader
Creates a defaultTypePoolthat looks up data by querying the plaform class loader. The returned instance is configured to use a fast reading mode and a simple cache. If the current VM is of version 8 or older, the extension class loader is represented instead.- Returns:
- A type pool that reads its data from the platform class path.
-
ofBootLoader
-
of
Returns a type pool for the provided class loader.- Parameters:
classLoader- The class loader for which this class pool is representing types.- Returns:
- An appropriate type pool.
-
of
Creates a defaultTypePoolthat looks up data by querying the supplied class file locator. The returned instance is configured to use a fast reading mode and a simple cache.- Parameters:
classFileLocator- The class file locator to use.- Returns:
- A type pool that reads its data from the system class path.
-
doDescribe
Description copied from class:TypePool.AbstractBaseDetermines a resolution to a non-primitive, non-array type.- Specified by:
doDescribein classTypePool.AbstractBase- Parameters:
name- The name of the type to describe.- Returns:
- A resolution to the type to describe.
-
doParse
Parses the supplied binary representation and returns a corresponding type description.- Parameters:
classReader- The ASM class reader to process.- Returns:
- An appropriate type description.
-