Package net.bytebuddy.pool
Class TypePool.AbstractBase.Hierarchical
- java.lang.Object
-
- net.bytebuddy.pool.TypePool.AbstractBase
-
- net.bytebuddy.pool.TypePool.AbstractBase.Hierarchical
-
- All Implemented Interfaces:
TypePool
- Direct Known Subclasses:
TypePool.ClassLoading
,TypePool.Default
,TypePool.Explicit
- Enclosing class:
- TypePool.AbstractBase
@Enhance public abstract static class TypePool.AbstractBase.Hierarchical extends TypePool.AbstractBase
Implements a hierarchical view of type pools, similarly to class loader hierarchies. For every lookup, the parent type pool is asked first if it can resolve a type. Only if the parent (and potentially its parents) are unable to resolve a type, this instance is queried for a type description.
-
-
Nested Class Summary
-
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
Fields Modifier and Type Field Description private TypePool
parent
The parent type pool.-
Fields inherited from class net.bytebuddy.pool.TypePool.AbstractBase
cacheProvider, PRIMITIVE_DESCRIPTORS, PRIMITIVE_TYPES
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Hierarchical(TypePool.CacheProvider cacheProvider, TypePool parent)
Creates a hierarchical type pool.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears this type pool's cache.TypePool.Resolution
describe(java.lang.String name)
Locates and describes the given type by its name.-
Methods inherited from class net.bytebuddy.pool.TypePool.AbstractBase
doCache, doDescribe
-
-
-
-
Field Detail
-
parent
private final TypePool parent
The parent type pool.
-
-
Constructor Detail
-
Hierarchical
protected Hierarchical(TypePool.CacheProvider cacheProvider, TypePool parent)
Creates a hierarchical type pool.- Parameters:
cacheProvider
- The cache provider to be used.parent
- The parent type pool to be used.
-
-
Method Detail
-
describe
public TypePool.Resolution describe(java.lang.String name)
Locates and describes the given type by its name.- Specified by:
describe
in interfaceTypePool
- Overrides:
describe
in classTypePool.AbstractBase
- 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.
-
clear
public void clear()
Clears this type pool's cache.- Specified by:
clear
in interfaceTypePool
- Overrides:
clear
in classTypePool.AbstractBase
-
-