Enum AgentBuilder.TypeStrategy.Default
- java.lang.Object
-
- java.lang.Enum<AgentBuilder.TypeStrategy.Default>
-
- net.bytebuddy.agent.builder.AgentBuilder.TypeStrategy.Default
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<AgentBuilder.TypeStrategy.Default>
,AgentBuilder.TypeStrategy
- Enclosing interface:
- AgentBuilder.TypeStrategy
public static enum AgentBuilder.TypeStrategy.Default extends java.lang.Enum<AgentBuilder.TypeStrategy.Default> implements AgentBuilder.TypeStrategy
Default implementations of type strategies.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder.TypeStrategy
AgentBuilder.TypeStrategy.Default, AgentBuilder.TypeStrategy.ForBuildEntryPoint
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DECORATE
A definition handler that performs a decoration of declared methods only.REBASE
A definition handler that performs a rebasing for all types.REDEFINE
A definition handler that performs a redefinition for all types.REDEFINE_FROZEN
A definition handler that performs a redefinition for all types and ignores all methods that were not declared by the instrumented type.
-
Constructor Summary
Constructors Modifier Constructor Description private
Default()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AgentBuilder.TypeStrategy.Default
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static AgentBuilder.TypeStrategy.Default[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface net.bytebuddy.agent.builder.AgentBuilder.TypeStrategy
builder
-
-
-
-
Enum Constant Detail
-
REBASE
public static final AgentBuilder.TypeStrategy.Default REBASE
A definition handler that performs a rebasing for all types.
-
REDEFINE
public static final AgentBuilder.TypeStrategy.Default REDEFINE
A definition handler that performs a redefinition for all types.
Note that the default agent builder is configured to apply a self initialization where a static class initializer is added to the redefined class. This can be disabled by for example using a
AgentBuilder.InitializationStrategy.Minimal
orAgentBuilder.InitializationStrategy.NoOp
. Also, consider the constraints implied byByteBuddy.redefine(TypeDescription, ClassFileLocator)
.For prohibiting any changes on a class file, use
AgentBuilder.disableClassFormatChanges()
-
REDEFINE_FROZEN
public static final AgentBuilder.TypeStrategy.Default REDEFINE_FROZEN
A definition handler that performs a redefinition for all types and ignores all methods that were not declared by the instrumented type.
Note that the default agent builder is configured to apply a self initialization where a static class initializer is added to the redefined class. This can be disabled by for example using a
AgentBuilder.InitializationStrategy.Minimal
orAgentBuilder.InitializationStrategy.NoOp
. Also, consider the constraints implied byByteBuddy.redefine(TypeDescription, ClassFileLocator)
. Using this strategy also configures Byte Buddy to create frozen instrumented types and discards any explicit configuration.For prohibiting any changes on a class file, use
AgentBuilder.disableClassFormatChanges()
-
DECORATE
public static final AgentBuilder.TypeStrategy.Default DECORATE
A definition handler that performs a decoration of declared methods only. Using this type strategy implies the limitations that are described by
ByteBuddy.decorate(TypeDescription, ClassFileLocator)
. This type strategy can be useful when only applyingAsmVisitorWrapper
s without attempting to change the class file layout..Note that the default agent builder is configured to apply a self initialization where a static class initializer is added to the redefined class. This can be disabled by for example using a
AgentBuilder.InitializationStrategy.Minimal
orAgentBuilder.InitializationStrategy.NoOp
. Also, consider the constraints implied byByteBuddy.redefine(TypeDescription, ClassFileLocator)
. Using this strategy also configures Byte Buddy to create frozen instrumented types and discards any explicit configuration.For prohibiting any changes on a class file, use
AgentBuilder.disableClassFormatChanges()
-
-
Method Detail
-
values
public static AgentBuilder.TypeStrategy.Default[] 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.TypeStrategy.Default c : AgentBuilder.TypeStrategy.Default.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.TypeStrategy.Default 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
-
-