Package net.bytebuddy.implementation
Class MethodCall.TargetHandler.ForValue.Factory
- java.lang.Object
-
- net.bytebuddy.implementation.MethodCall.TargetHandler.ForValue.Factory
-
- All Implemented Interfaces:
InstrumentedType.Prepareable
,MethodCall.TargetHandler.Factory
- Enclosing class:
- MethodCall.TargetHandler.ForValue
@Enhance protected static class MethodCall.TargetHandler.ForValue.Factory extends java.lang.Object implements MethodCall.TargetHandler.Factory
A factory for a target handler that loads a specific value.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
FIELD_PREFIX
The name prefix of the field to store the instance.private TypeDescription.Generic
fieldType
The type of the field.private java.lang.String
name
The name of the field to store the target.private java.lang.Object
target
The target on which the method is to be invoked.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Factory(java.lang.Object target, TypeDescription.Generic fieldType)
Creates a new target handler for a static field.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodCall.TargetHandler
make(Implementation.Target implementationTarget)
Creates a target handler for a given implementation target.InstrumentedType
prepare(InstrumentedType instrumentedType)
Prepares a given instrumented type.
-
-
-
Field Detail
-
FIELD_PREFIX
private static final java.lang.String FIELD_PREFIX
The name prefix of the field to store the instance.- See Also:
- Constant Field Values
-
target
private final java.lang.Object target
The target on which the method is to be invoked.
-
fieldType
private final TypeDescription.Generic fieldType
The type of the field.
-
name
@ValueHandling(IGNORE) private final java.lang.String name
The name of the field to store the target.
-
-
Constructor Detail
-
Factory
protected Factory(java.lang.Object target, TypeDescription.Generic fieldType)
Creates a new target handler for a static field.- Parameters:
target
- The target on which the method is to be invoked.fieldType
- The type of the field.
-
-
Method Detail
-
prepare
public InstrumentedType prepare(InstrumentedType instrumentedType)
Prepares a given instrumented type.- Specified by:
prepare
in interfaceInstrumentedType.Prepareable
- Parameters:
instrumentedType
- The instrumented type in its current form.- Returns:
- The prepared instrumented type.
-
make
public MethodCall.TargetHandler make(Implementation.Target implementationTarget)
Creates a target handler for a given implementation target.- Specified by:
make
in interfaceMethodCall.TargetHandler.Factory
- Parameters:
implementationTarget
- The implementation target to use.- Returns:
- The target handler to use.
-
-