Package net.bytebuddy.agent.builder
Enum AgentBuilder.PoolStrategy.ClassLoading
- java.lang.Object
-
- java.lang.Enum<AgentBuilder.PoolStrategy.ClassLoading>
-
- net.bytebuddy.agent.builder.AgentBuilder.PoolStrategy.ClassLoading
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<AgentBuilder.PoolStrategy.ClassLoading>
,AgentBuilder.PoolStrategy
- Enclosing interface:
- AgentBuilder.PoolStrategy
public static enum AgentBuilder.PoolStrategy.ClassLoading extends java.lang.Enum<AgentBuilder.PoolStrategy.ClassLoading> implements AgentBuilder.PoolStrategy
A type locator that attempts loading a type if it cannot be located by the underlying lazy type pool.
The returned type pool uses a
TypePool.CacheProvider.Simple
and theClassFileLocator
that is provided by the builder'sAgentBuilder.LocationStrategy
. Any types are loaded via the instrumented type'sClassLoader
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder.PoolStrategy
AgentBuilder.PoolStrategy.ClassLoading, AgentBuilder.PoolStrategy.Default, AgentBuilder.PoolStrategy.Eager, AgentBuilder.PoolStrategy.WithTypePoolCache
-
-
Enum Constant Summary
Enum Constants Enum Constant Description EXTENDED
A type locator that parses the code segment of each method for extracting information about parameter names even if they are not explicitly included in a class file.FAST
A type locator that skips the code segment of each method and does therefore not extract information about parameter names.
-
Field Summary
Fields Modifier and Type Field Description private TypePool.Default.ReaderMode
readerMode
The reader mode to apply by this type locator.
-
Constructor Summary
Constructors Modifier Constructor Description private
ClassLoading(TypePool.Default.ReaderMode readerMode)
Creates a new type locator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TypePool
typePool(ClassFileLocator classFileLocator, java.lang.ClassLoader classLoader)
Creates a type pool for a given class file locator.TypePool
typePool(ClassFileLocator classFileLocator, java.lang.ClassLoader classLoader, java.lang.String name)
Creates a type pool for a given class file locator.static AgentBuilder.PoolStrategy.ClassLoading
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static AgentBuilder.PoolStrategy.ClassLoading[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
EXTENDED
public static final AgentBuilder.PoolStrategy.ClassLoading EXTENDED
A type locator that parses the code segment of each method for extracting information about parameter names even if they are not explicitly included in a class file.- See Also:
TypePool.Default.ReaderMode.EXTENDED
-
FAST
public static final AgentBuilder.PoolStrategy.ClassLoading FAST
A type locator that skips the code segment of each method and does therefore not extract information about parameter names. Parameter names are still included if they are explicitly included in a class file.- See Also:
TypePool.Default.ReaderMode.FAST
-
-
Field Detail
-
readerMode
private final TypePool.Default.ReaderMode readerMode
The reader mode to apply by this type locator.
-
-
Constructor Detail
-
ClassLoading
private ClassLoading(TypePool.Default.ReaderMode readerMode)
Creates a new type locator.- Parameters:
readerMode
- The reader mode to apply by this type locator.
-
-
Method Detail
-
values
public static AgentBuilder.PoolStrategy.ClassLoading[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (AgentBuilder.PoolStrategy.ClassLoading c : AgentBuilder.PoolStrategy.ClassLoading.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AgentBuilder.PoolStrategy.ClassLoading valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
typePool
public TypePool typePool(ClassFileLocator classFileLocator, java.lang.ClassLoader classLoader)
Creates a type pool for a given class file locator.- Specified by:
typePool
in interfaceAgentBuilder.PoolStrategy
- Parameters:
classFileLocator
- The class file locator to use.classLoader
- The class loader for which the class file locator was created.- Returns:
- A type pool for the supplied class file locator.
-
typePool
public TypePool typePool(ClassFileLocator classFileLocator, java.lang.ClassLoader classLoader, java.lang.String name)
Creates a type pool for a given class file locator. If a cache is used, the type that is currently instrumented is not used.- Specified by:
typePool
in interfaceAgentBuilder.PoolStrategy
- Parameters:
classFileLocator
- The class file locator to use.classLoader
- The class loader for which the class file locator was created.name
- The name of the currently instrumented type.- Returns:
- A type pool for the supplied class file locator.
-
-