protected class Field.Binder.AccessorProxy extends Object implements AuxiliaryType, StackManipulation
AuxiliaryType.MethodAccessorFactory
StackManipulation.Compound, StackManipulation.Illegal, StackManipulation.LegalTrivial, StackManipulation.Size
Modifier and Type | Field and Description |
---|---|
protected static String |
FIELD_NAME
The name of the field that stores the accessed instance if any.
|
DEFAULT_TYPE_MODIFIER
Modifier | Constructor and Description |
---|---|
protected |
AccessorProxy(FieldDescription accessedField,
Assigner assigner,
TypeDescription instrumentedType,
Field.Binder.AccessType accessType,
boolean serializableProxy) |
Modifier and Type | Method and Description |
---|---|
StackManipulation.Size |
apply(org.objectweb.asm.MethodVisitor methodVisitor,
Instrumentation.Context instrumentationContext)
Applies the stack manipulation that is described by this instance.
|
boolean |
equals(Object other) |
int |
hashCode() |
boolean |
isValid()
Determines if this stack manipulation is valid.
|
DynamicType |
make(String auxiliaryTypeName,
ClassFileVersion classFileVersion,
AuxiliaryType.MethodAccessorFactory methodAccessorFactory)
Creates a new auxiliary type.
|
String |
toString() |
protected static final String FIELD_NAME
protected AccessorProxy(FieldDescription accessedField, Assigner assigner, TypeDescription instrumentedType, Field.Binder.AccessType accessType, boolean serializableProxy)
accessedField
- The field that is being accessed.assigner
- The assigner to use.instrumentedType
- The type which is accessed.accessType
- The assigner to use.serializableProxy
- true
if the generated proxy should be serializable.public DynamicType make(String auxiliaryTypeName, ClassFileVersion classFileVersion, AuxiliaryType.MethodAccessorFactory methodAccessorFactory)
AuxiliaryType
make
in interface AuxiliaryType
auxiliaryTypeName
- The fully qualified non-internal name for this auxiliary type. The type should be in
the same package than the instrumented type this auxiliary type is providing services
to in order to allow package-private access.classFileVersion
- The class file version the auxiliary class should be written in.methodAccessorFactory
- A factory for accessor methods.public boolean isValid()
StackManipulation
isValid
in interface StackManipulation
false
, this manipulation cannot be applied and should throw an exception.public StackManipulation.Size apply(org.objectweb.asm.MethodVisitor methodVisitor, Instrumentation.Context instrumentationContext)
StackManipulation
apply
in interface StackManipulation
methodVisitor
- The method visitor used to write the method implementation to.instrumentationContext
- The context of the current instrumentation.Copyright © 2014. All rights reserved.