protected static class Instrumentation.Context.Default.FieldSetter extends Object implements TypeWriter.MethodPool.Entry, ByteCodeAppender
TypeWriter.MethodPool.Entry.Factory, TypeWriter.MethodPool.Entry.Simple, TypeWriter.MethodPool.Entry.Skip
ByteCodeAppender.Compound, ByteCodeAppender.Simple, ByteCodeAppender.Size
Modifier | Constructor and Description |
---|---|
protected |
FieldSetter(FieldDescription fieldDescription)
Creates a new field setter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
appendsCode()
Determines if this byte code appender offers an (possibly empty) implementation of a method.
|
void |
apply(org.objectweb.asm.ClassVisitor classVisitor,
Instrumentation.Context instrumentationContext,
MethodDescription methodDescription)
Writes the method that is represented by this entry to the provided class visitor.
|
ByteCodeAppender.Size |
apply(org.objectweb.asm.MethodVisitor methodVisitor,
Instrumentation.Context instrumentationContext,
MethodDescription instrumentedMethod)
Applies this byte code appender to a type creation process.
|
boolean |
equals(Object other) |
MethodAttributeAppender |
getAttributeAppender()
The method attribute appender that is to be used for the instrumentation by this entry.
|
ByteCodeAppender |
getByteCodeAppender()
The byte code appender to be used for the instrumentation by this entry.
|
int |
hashCode() |
boolean |
isDefineMethod()
Determines if this entry requires a method to be defined for a given instrumentation.
|
String |
toString() |
protected FieldSetter(FieldDescription fieldDescription)
fieldDescription
- The field to write to.public boolean isDefineMethod()
TypeWriter.MethodPool.Entry
isDefineMethod
in interface TypeWriter.MethodPool.Entry
true
if a method should be defined for a given instrumentation.public ByteCodeAppender getByteCodeAppender()
TypeWriter.MethodPool.Entry
TypeWriter.MethodPool.Entry.isDefineMethod()
returns false
.getByteCodeAppender
in interface TypeWriter.MethodPool.Entry
public MethodAttributeAppender getAttributeAppender()
TypeWriter.MethodPool.Entry
TypeWriter.MethodPool.Entry.isDefineMethod()
returns false
.getAttributeAppender
in interface TypeWriter.MethodPool.Entry
public boolean appendsCode()
ByteCodeAppender
appendsCode
in interface ByteCodeAppender
true
if this byte code appender requires this method to be implemented or false
if this
appender describes an abstract method.public ByteCodeAppender.Size apply(org.objectweb.asm.MethodVisitor methodVisitor, Instrumentation.Context instrumentationContext, MethodDescription instrumentedMethod)
ByteCodeAppender
apply
in interface ByteCodeAppender
methodVisitor
- The method visitor to which the byte code appender writes its code to.instrumentationContext
- The instrumentation context of the current type creation process.instrumentedMethod
- The method that is the target of the instrumentation.public void apply(org.objectweb.asm.ClassVisitor classVisitor, Instrumentation.Context instrumentationContext, MethodDescription methodDescription)
TypeWriter.MethodPool.Entry
apply
in interface TypeWriter.MethodPool.Entry
classVisitor
- The class visitor to which this entry is to be written to.instrumentationContext
- The instrumentation context to use for writing this method.methodDescription
- A description of the method that is to be writtenCopyright © 2014. All rights reserved.