protected static class FieldAccessor.ForUnnamedField extends FieldAccessor implements FieldAccessor.OwnerTypeLocatable
ofBeanProperty
FieldAccessor.Appender, FieldAccessor.AssignerConfigurable, FieldAccessor.FieldDefinable, FieldAccessor.FieldLocator, FieldAccessor.FieldNameExtractor, FieldAccessor.ForNamedField, FieldAccessor.ForUnnamedField, FieldAccessor.OwnerTypeLocatable
Instrumentation.Compound, Instrumentation.Context, Instrumentation.ForAbstractMethod, Instrumentation.Simple, Instrumentation.SpecialMethodInvocation, Instrumentation.Target
assigner, dynamicallyTyped
Modifier | Constructor and Description |
---|---|
protected |
ForUnnamedField(Assigner assigner,
boolean dynamicallyTyped,
FieldAccessor.FieldNameExtractor fieldNameExtractor)
Creates a new field accessor instrumentation.
|
protected |
ForUnnamedField(Assigner assigner,
boolean dynamicallyTyped,
FieldAccessor.FieldNameExtractor fieldNameExtractor,
FieldAccessor.FieldLocator.Factory fieldLocatorFactory)
Creates a new field accessor instrumentation.
|
Modifier and Type | Method and Description |
---|---|
ByteCodeAppender |
appender(Instrumentation.Target instrumentationTarget)
Creates a byte code appender that determines the implementation of the instrumented type's methods.
|
boolean |
equals(Object other) |
protected String |
getFieldName(MethodDescription targetMethod)
Locates a field's name.
|
int |
hashCode() |
FieldAccessor.AssignerConfigurable |
in(Class<?> type)
Determines that a field should only be considered when it was defined in a given type.
|
FieldAccessor.AssignerConfigurable |
in(FieldAccessor.FieldLocator.Factory fieldLocatorFactory)
Determines that a field should only be considered when it was identified by a field locator that is
produced by the given factory.
|
FieldAccessor.AssignerConfigurable |
in(TypeDescription typeDescription)
Determines that a field should only be considered when it was defined in a given type.
|
InstrumentedType |
prepare(InstrumentedType instrumentedType)
During the preparation phase of an instrumentation, implementations are eligible to adding fields or methods
to the currently instrumented type.
|
String |
toString() |
Instrumentation |
withAssigner(Assigner assigner,
boolean dynamicallyTyped)
Returns a field accessor that is identical to this field accessor but uses the given assigner
and runtime type use configuration.
|
applyGetter, applySetter, of, ofBeanProperty, ofField
protected ForUnnamedField(Assigner assigner, boolean dynamicallyTyped, FieldAccessor.FieldNameExtractor fieldNameExtractor)
assigner
- The assigner to use.dynamicallyTyped
- true
if a field value's runtime type should be considered.fieldNameExtractor
- The field name extractor to use.protected ForUnnamedField(Assigner assigner, boolean dynamicallyTyped, FieldAccessor.FieldNameExtractor fieldNameExtractor, FieldAccessor.FieldLocator.Factory fieldLocatorFactory)
assigner
- The assigner to use.dynamicallyTyped
- true
if a field value's runtime type should be considered.fieldNameExtractor
- The field name extractor to use.fieldLocatorFactory
- A factory that will produce a field locator that will be used to find locate
a field to be accessed.public FieldAccessor.AssignerConfigurable in(FieldAccessor.FieldLocator.Factory fieldLocatorFactory)
FieldAccessor.OwnerTypeLocatable
in
in interface FieldAccessor.OwnerTypeLocatable
fieldLocatorFactory
- A factory that will produce a field locator that will be used to find locate
a field to be accessed.public FieldAccessor.AssignerConfigurable in(Class<?> type)
FieldAccessor.OwnerTypeLocatable
in
in interface FieldAccessor.OwnerTypeLocatable
type
- The type to be considered.public FieldAccessor.AssignerConfigurable in(TypeDescription typeDescription)
FieldAccessor.OwnerTypeLocatable
in
in interface FieldAccessor.OwnerTypeLocatable
typeDescription
- A description of the type to be considered.public Instrumentation withAssigner(Assigner assigner, boolean dynamicallyTyped)
FieldAccessor.AssignerConfigurable
withAssigner
in interface FieldAccessor.AssignerConfigurable
assigner
- The assigner to use.dynamicallyTyped
- true
if a field value's runtime type should be considered.public InstrumentedType prepare(InstrumentedType instrumentedType)
Instrumentation
ByteCodeAppender
that is emitted
on the call to
Instrumentation.appender(net.bytebuddy.instrumentation.Instrumentation.Target)
call. On this method call, loaded type initializers can also be added to the instrumented type.prepare
in interface Instrumentation
instrumentedType
- The instrumented type that is the basis of the ongoing instrumentation.public ByteCodeAppender appender(Instrumentation.Target instrumentationTarget)
Instrumentation
appender
in interface Instrumentation
instrumentationTarget
- The target of the current instrumentation.Instrumentation.prepare(net.bytebuddy.instrumentation.type.InstrumentedType)
.protected String getFieldName(MethodDescription targetMethod)
FieldAccessor
getFieldName
in class FieldAccessor
targetMethod
- The method that is target of the instrumentation.public boolean equals(Object other)
equals
in class FieldAccessor
public int hashCode()
hashCode
in class FieldAccessor
Copyright © 2014–2015. All rights reserved.