Package net.bytebuddy.pool
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.Resolution
s that are produced by this type pool are either fully resolved or not resolved at all.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interface
An annotation registrant implements a visitor pattern for reading an unknown amount of values of annotations.protected static interface
A component type locator allows for the lazy location of an array's component type.protected static class
A generic type extractor allows for an iterative extraction of generic type information.protected static interface
A type registrant allows to register a generic type token.protected static class
A type description that looks up any referencedByteCodeElement
orAnnotationDescription
by querying a type pool at lookup time.protected static class
A bag for collecting parameter meta information that is stored as debug information for implemented methods.static enum
Determines the granularity of the class file parsing that is conducted by aTypePool.Default
.protected class
A type extractor reads a class file and collects data that is relevant to create a type description.static class
A variant ofTypePool.Default
that resolves type descriptions lazily.Nested classes/interfaces inherited from class net.bytebuddy.pool.TypePool.AbstractBase
TypePool.AbstractBase.ArrayTypeResolution, TypePool.AbstractBase.ComponentTypeReference, TypePool.AbstractBase.Hierarchical
Nested classes/interfaces inherited from interface net.bytebuddy.pool.TypePool
TypePool.AbstractBase, TypePool.CacheProvider, TypePool.ClassLoading, TypePool.Default, TypePool.Empty, TypePool.Explicit, TypePool.LazyFacade, TypePool.Resolution
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ClassFileLocator
The locator to query for finding binary data of a type.private static final org.objectweb.asm.MethodVisitor
Indicates that a visited method should be ignored.protected final TypePool.Default.ReaderMode
The reader mode to apply by this default type pool.Fields inherited from class net.bytebuddy.pool.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. -
Method Summary
Modifier and TypeMethodDescriptionprotected TypePool.Resolution
doDescribe
(String name) Determines a resolution to a non-primitive, non-array type.static TypePool
of
(ClassLoader classLoader) Returns a type pool for the provided class loader.static TypePool
of
(ClassFileLocator classFileLocator) Creates a defaultTypePool
that looks up data by querying the supplied class file locator.static TypePool
Creates a defaultTypePool
that looks up data by querying the boot class loader.static TypePool
Creates a defaultTypePool
that looks up data by querying the plaform class loader.static TypePool
Creates a defaultTypePool
that looks up data by querying the system class loader.private TypeDescription
parse
(byte[] binaryRepresentation) Parses a binary representation and transforms it into a type description.Methods inherited from class net.bytebuddy.pool.TypePool.AbstractBase.Hierarchical
clear, describe
Methods inherited from class net.bytebuddy.pool.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.
-
-
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.
-
-
Method Details
-
ofSystemLoader
Creates a defaultTypePool
that looks up data by querying the system class loader. The returned instance is configured to use a fast reading mode and a simple cache.- Returns:
- A type pool that reads its data from the system class loader.
-
ofPlatformLoader
Creates a defaultTypePool
that 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
Creates a defaultTypePool
that looks up data by querying the boot class loader. The returned instance is configured to use a fast reading mode and a simple cache.- Returns:
- A type pool that reads its data from the boot class loader.
-
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 defaultTypePool
that 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.AbstractBase
Determines a resolution to a non-primitive, non-array type.- Specified by:
doDescribe
in classTypePool.AbstractBase
- Parameters:
name
- The name of the type to describe.- Returns:
- A resolution to the type to describe.
-
parse
Parses a binary representation and transforms it into a type description.- Parameters:
binaryRepresentation
- The binary data to be parsed.- Returns:
- A type description of the binary data.
-