Package net.bytebuddy.implementation
Class FieldAccessor.ForImplicitProperty
- java.lang.Object
-
- net.bytebuddy.implementation.FieldAccessor
-
- net.bytebuddy.implementation.FieldAccessor.ForImplicitProperty
-
- All Implemented Interfaces:
InstrumentedType.Prepareable
,FieldAccessor.AssignerConfigurable
,FieldAccessor.OwnerTypeLocatable
,FieldAccessor.PropertyConfigurable
,Implementation
- Enclosing class:
- FieldAccessor
protected static class FieldAccessor.ForImplicitProperty extends FieldAccessor implements FieldAccessor.OwnerTypeLocatable
A field accessor for an implicit property where a getter or setter property is inferred from the signature.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
FieldAccessor.ForImplicitProperty.Appender
An byte code appender for an field accessor implementation.-
Nested classes/interfaces inherited from class net.bytebuddy.implementation.FieldAccessor
FieldAccessor.AssignerConfigurable, FieldAccessor.FieldLocation, FieldAccessor.FieldNameExtractor, FieldAccessor.ForImplicitProperty, FieldAccessor.ForParameterSetter, FieldAccessor.OwnerTypeLocatable, FieldAccessor.PropertyConfigurable
-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.Implementation
Implementation.Composable, Implementation.Compound, Implementation.Context, Implementation.Simple, Implementation.SpecialMethodInvocation, Implementation.Target
-
-
Field Summary
-
Fields inherited from class net.bytebuddy.implementation.FieldAccessor
assigner, fieldLocation, typing
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForImplicitProperty(FieldAccessor.FieldLocation fieldLocation)
Creates a field accessor for an implicit property.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteCodeAppender
appender(Implementation.Target implementationTarget)
Creates a byte code appender that determines the implementation of the instrumented type's methods.FieldAccessor.AssignerConfigurable
in(java.lang.Class<?> type)
Determines that a field should only be considered when it was defined in a given type.FieldAccessor.AssignerConfigurable
in(TypeDescription typeDescription)
Determines that a field should only be considered when it was defined in a given type.FieldAccessor.AssignerConfigurable
in(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.Implementation.Composable
setsArgumentAt(int index)
Creates a field accessor for the described field that serves as a setter for the supplied parameter index.FieldAccessor.PropertyConfigurable
withAssigner(Assigner assigner, Assigner.Typing typing)
Returns a field accessor that is identical to this field accessor but uses the given assigner and runtime type use configuration.-
Methods inherited from class net.bytebuddy.implementation.FieldAccessor
getter, of, of, of, ofBeanProperty, ofField, prepare, setter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable
prepare
-
-
-
-
Constructor Detail
-
ForImplicitProperty
protected ForImplicitProperty(FieldAccessor.FieldLocation fieldLocation)
Creates a field accessor for an implicit property.- Parameters:
fieldLocation
- The field's location.
-
-
Method Detail
-
appender
public ByteCodeAppender appender(Implementation.Target implementationTarget)
Description copied from interface:Implementation
Creates a byte code appender that determines the implementation of the instrumented type's methods.- Specified by:
appender
in interfaceImplementation
- Parameters:
implementationTarget
- The target of the current implementation.- Returns:
- A byte code appender for implementing methods delegated to this implementation. This byte code appender
is also responsible for handling methods that were added by this implementation on the call to
InstrumentedType.Prepareable.prepare(InstrumentedType)
.
-
setsArgumentAt
public Implementation.Composable setsArgumentAt(int index)
Description copied from interface:FieldAccessor.PropertyConfigurable
Creates a field accessor for the described field that serves as a setter for the supplied parameter index. The instrumented method must returnvoid
or a chained instrumentation must be supplied.- Specified by:
setsArgumentAt
in interfaceFieldAccessor.PropertyConfigurable
- Parameters:
index
- The index of the parameter for which to set the field's value.- Returns:
- An instrumentation that sets the parameter's value to the described field.
-
withAssigner
public FieldAccessor.PropertyConfigurable withAssigner(Assigner assigner, Assigner.Typing typing)
Description copied from interface:FieldAccessor.AssignerConfigurable
Returns a field accessor that is identical to this field accessor but uses the given assigner and runtime type use configuration.- Specified by:
withAssigner
in interfaceFieldAccessor.AssignerConfigurable
- Parameters:
assigner
- The assigner to use.typing
- Indicates if dynamic type castings should be attempted for incompatible assignments.- Returns:
- This field accessor with the given assigner and runtime type use configuration.
-
in
public FieldAccessor.AssignerConfigurable in(java.lang.Class<?> type)
Description copied from interface:FieldAccessor.OwnerTypeLocatable
Determines that a field should only be considered when it was defined in a given type.- Specified by:
in
in interfaceFieldAccessor.OwnerTypeLocatable
- Parameters:
type
- The type to be considered.- Returns:
- This field accessor which will only considered fields that are defined in the given type.
-
in
public FieldAccessor.AssignerConfigurable in(TypeDescription typeDescription)
Description copied from interface:FieldAccessor.OwnerTypeLocatable
Determines that a field should only be considered when it was defined in a given type.- Specified by:
in
in interfaceFieldAccessor.OwnerTypeLocatable
- Parameters:
typeDescription
- A description of the type to be considered.- Returns:
- This field accessor which will only considered fields that are defined in the given type.
-
in
public FieldAccessor.AssignerConfigurable in(FieldLocator.Factory fieldLocatorFactory)
Description copied from interface:FieldAccessor.OwnerTypeLocatable
Determines that a field should only be considered when it was identified by a field locator that is produced by the given factory.- Specified by:
in
in interfaceFieldAccessor.OwnerTypeLocatable
- Parameters:
fieldLocatorFactory
- A factory that will produce a field locator that will be used to find locate a field to be accessed.- Returns:
- This field accessor which will only considered fields that are defined in the given type.
-
-