Package net.bytebuddy.pool
Class TypePool.AbstractBase
java.lang.Object
net.bytebuddy.pool.TypePool.AbstractBase
- All Implemented Interfaces:
TypePool
- Direct Known Subclasses:
TypePool.AbstractBase.Hierarchical
,TypePool.LazyFacade
- Enclosing interface:
TypePool
A base implementation of a
TypePool
that is managing a cache provider and
that handles the description of array and primitive types.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
A resolution for a type that, if resolved, represents an array type.protected static interface
A lazy representation of the component type of an array.static class
Implements a hierarchical view of type pools, similarly to class loader hierarchies.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 TypeFieldDescriptionprivate static final String
The array symbol as used by Java descriptors.protected final TypePool.CacheProvider
The cache provider of this instance.A map of primitive types by their descriptor.protected static final Map
<String, TypeDescription> A map of primitive types by their name. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractBase
(TypePool.CacheProvider cacheProvider) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears this type pool's cache.Locates and describes the given type by its name.protected TypePool.Resolution
doCache
(String name, TypePool.Resolution resolution) Writes the resolution to the cache.protected abstract TypePool.Resolution
doDescribe
(String name) Determines a resolution to a non-primitive, non-array type.
-
Field Details
-
PRIMITIVE_TYPES
A map of primitive types by their name. -
PRIMITIVE_DESCRIPTORS
A map of primitive types by their descriptor. -
ARRAY_SYMBOL
The array symbol as used by Java descriptors.- See Also:
-
cacheProvider
The cache provider of this instance.
-
-
Constructor Details
-
AbstractBase
Creates a new instance.- Parameters:
cacheProvider
- The cache provider to be used.
-
-
Method Details
-
describe
Locates and describes the given type by its name.- Specified by:
describe
in interfaceTypePool
- Parameters:
name
- The name of the type to describe. The name is to be written as when callingObject.toString()
on a loadedClass
.- Returns:
- A resolution of the type to describe. If the type to be described was found, the returned
TypePool.Resolution
represents this type. Otherwise, an illegal resolution is returned.
-
doCache
Writes the resolution to the cache. This method should be overridden if the directly resolved instance should not be added to the cache.- Parameters:
name
- The name of the type.resolution
- The resolution for this type.- Returns:
- The actual resolution for the type of this name that is stored in the cache.
-
clear
public void clear()Clears this type pool's cache. -
doDescribe
Determines a resolution to a non-primitive, non-array type.- Parameters:
name
- The name of the type to describe.- Returns:
- A resolution to the type to describe.
-