Top Description Inners Methods
net.bytebuddy.implementation

public Interface MethodAccessorFactory

Known Direct Subinterfaces
net.bytebuddy.implementation.Implementation.Context
Known Direct Implementers
net.bytebuddy.implementation.MethodAccessorFactory.Illegal
Imports
net.bytebuddy.description.field.FieldDescription, net.bytebuddy.description.method.MethodDescription, net.bytebuddy.description.modifier.Visibility

A factory for creating method proxies for an auxiliary type. Such proxies are required to allow a type to call methods of a second type that are usually not accessible for the first type. This strategy is also adapted by the Java compiler that creates accessor methods for example to implement inner classes.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
MethodAccessorFactory.AccessType

Indicates the type of access to an accessor method.

public static enum
MethodAccessorFactory.Illegal

A method accessor factory that forbids any accessor registration.

Method Summary

Modifier and TypeMethod and Description
public MethodDescription.InDefinedShape

Returns:

The accessor method for invoking the special method invocation.
registerAccessorFor
(Implementation.SpecialMethodInvocation
The special method invocation.
specialMethodInvocation
,
MethodAccessorFactory.AccessType
The required access type.
accessType
)

Registers an accessor method for a Implementation.SpecialMethodInvocation which cannot itself be triggered invoked directly from outside a type.

public MethodDescription.InDefinedShape

Returns:

A getter method for the given field.
registerGetterFor
(FieldDescription
The field which is to be accessed.
fieldDescription
,
MethodAccessorFactory.AccessType
The required access type.
accessType
)

Registers a getter for the given net.bytebuddy.description.field.FieldDescription which might itself not be accessible from outside the class.

public MethodDescription.InDefinedShape

Returns:

A setter method for the given field.
registerSetterFor
(FieldDescription
The field which is to be accessed.
fieldDescription
,
MethodAccessorFactory.AccessType
The required access type.
accessType
)

Registers a setter for the given FieldDescription which might itself not be accessible from outside the class.

Method Detail

registerAccessorForback to summary
public MethodDescription.InDefinedShape registerAccessorFor(Implementation.SpecialMethodInvocation specialMethodInvocation, MethodAccessorFactory.AccessType accessType)

Registers an accessor method for a Implementation.SpecialMethodInvocation which cannot itself be triggered invoked directly from outside a type. The method is registered on the instrumented type with package-private visibility, similarly to a Java compiler's accessor methods.

Parameters
specialMethodInvocation:Implementation.SpecialMethodInvocation

The special method invocation.

accessType:MethodAccessorFactory.AccessType

The required access type.

Returns:MethodDescription.InDefinedShape

The accessor method for invoking the special method invocation.

registerGetterForback to summary
public MethodDescription.InDefinedShape registerGetterFor(FieldDescription fieldDescription, MethodAccessorFactory.AccessType accessType)

Registers a getter for the given net.bytebuddy.description.field.FieldDescription which might itself not be accessible from outside the class. The returned getter method defines the field type as its return type, does not take any arguments and is of package-private visibility, similarly to the Java compiler's accessor methods. If the field is static, this accessor method is also static.

Parameters
fieldDescription:FieldDescription

The field which is to be accessed.

accessType:MethodAccessorFactory.AccessType

The required access type.

Returns:MethodDescription.InDefinedShape

A getter method for the given field.

registerSetterForback to summary
public MethodDescription.InDefinedShape registerSetterFor(FieldDescription fieldDescription, MethodAccessorFactory.AccessType accessType)

Registers a setter for the given FieldDescription which might itself not be accessible from outside the class. The returned setter method defines the field type as its only argument type, returns void and is of package-private visibility, similarly to the Java compiler's accessor methods. If the field is static, this accessor method is also static.

Parameters
fieldDescription:FieldDescription

The field which is to be accessed.

accessType:MethodAccessorFactory.AccessType

The required access type.

Returns:MethodDescription.InDefinedShape

A setter method for the given field.

net.bytebuddy.implementation back to summary

public final Enum MethodAccessorFactory.AccessType

extends Enum<MethodAccessorFactory.AccessType>
Class Inheritance

Indicates the type of access to an accessor method.

Field Summary

Modifier and TypeField and Description
public static final MethodAccessorFactory.AccessType
DEFAULT

An access with default visibility.

public static final MethodAccessorFactory.AccessType
PUBLIC

An access with public visibility.

private final Visibility
visibility

The implied visibility.

Constructor Summary

AccessConstructor and Description
private
AccessType(Visibility
The implied visibility.
visibility
)

Creates a new access type.

Method Summary

Modifier and TypeMethod and Description
public Visibility

Returns:

The implied visibility.
getVisibility
()

Returns the implied visibility.

public static MethodAccessorFactory.AccessType
public static MethodAccessorFactory.AccessType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DEFAULTback to summary
public static final MethodAccessorFactory.AccessType DEFAULT

An access with default visibility.

PUBLICback to summary
public static final MethodAccessorFactory.AccessType PUBLIC

An access with public visibility.

visibilityback to summary
private final Visibility visibility

The implied visibility.

Constructor Detail

AccessTypeback to summary
private AccessType(Visibility visibility)

Creates a new access type.

Parameters
visibility:Visibility

The implied visibility.

Method Detail

getVisibilityback to summary
public Visibility getVisibility()

Returns the implied visibility.

Returns:Visibility

The implied visibility.

valueOfback to summary
public static MethodAccessorFactory.AccessType valueOf(String name)
valuesback to summary
public static MethodAccessorFactory.AccessType[] values()
net.bytebuddy.implementation back to summary

public final Enum MethodAccessorFactory.Illegal

extends Enum<MethodAccessorFactory.Illegal>
implements MethodAccessorFactory
Class Inheritance
All Implemented Interfaces
net.bytebuddy.implementation.MethodAccessorFactory

A method accessor factory that forbids any accessor registration.

Field Summary

Modifier and TypeField and Description
public static final MethodAccessorFactory.Illegal
INSTANCE

The singleton instance.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public MethodDescription.InDefinedShape
registerAccessorFor(Implementation.SpecialMethodInvocation
The special method invocation.
specialMethodInvocation
,
MethodAccessorFactory.AccessType
The required access type.
accessType
)

Implements net.bytebuddy.implementation.MethodAccessorFactory.registerAccessorFor.

Registers an accessor method for a Implementation.SpecialMethodInvocation which cannot itself be triggered invoked directly from outside a type.
public MethodDescription.InDefinedShape
registerGetterFor(FieldDescription
The field which is to be accessed.
fieldDescription
,
MethodAccessorFactory.AccessType
The required access type.
accessType
)

Implements net.bytebuddy.implementation.MethodAccessorFactory.registerGetterFor.

Registers a getter for the given net.bytebuddy.description.field.FieldDescription which might itself not be accessible from outside the class.
public MethodDescription.InDefinedShape
registerSetterFor(FieldDescription
The field which is to be accessed.
fieldDescription
,
MethodAccessorFactory.AccessType
The required access type.
accessType
)

Implements net.bytebuddy.implementation.MethodAccessorFactory.registerSetterFor.

Registers a setter for the given FieldDescription which might itself not be accessible from outside the class.
public static MethodAccessorFactory.Illegal
public static MethodAccessorFactory.Illegal[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final MethodAccessorFactory.Illegal INSTANCE

The singleton instance.

Constructor Detail

Illegalback to summary
private Illegal()

Method Detail

registerAccessorForback to summary
public MethodDescription.InDefinedShape registerAccessorFor(Implementation.SpecialMethodInvocation specialMethodInvocation, MethodAccessorFactory.AccessType accessType)

Implements net.bytebuddy.implementation.MethodAccessorFactory.registerAccessorFor.

Doc from net.bytebuddy.implementation.MethodAccessorFactory.registerAccessorFor.

Registers an accessor method for a Implementation.SpecialMethodInvocation which cannot itself be triggered invoked directly from outside a type. The method is registered on the instrumented type with package-private visibility, similarly to a Java compiler's accessor methods.

Parameters
specialMethodInvocation:Implementation.SpecialMethodInvocation

The special method invocation.

accessType:MethodAccessorFactory.AccessType

The required access type.

Returns:MethodDescription.InDefinedShape

The accessor method for invoking the special method invocation.

registerGetterForback to summary
public MethodDescription.InDefinedShape registerGetterFor(FieldDescription fieldDescription, MethodAccessorFactory.AccessType accessType)

Implements net.bytebuddy.implementation.MethodAccessorFactory.registerGetterFor.

Doc from net.bytebuddy.implementation.MethodAccessorFactory.registerGetterFor.

Registers a getter for the given net.bytebuddy.description.field.FieldDescription which might itself not be accessible from outside the class. The returned getter method defines the field type as its return type, does not take any arguments and is of package-private visibility, similarly to the Java compiler's accessor methods. If the field is static, this accessor method is also static.

Parameters
fieldDescription:FieldDescription

The field which is to be accessed.

accessType:MethodAccessorFactory.AccessType

The required access type.

Returns:MethodDescription.InDefinedShape

A getter method for the given field.

registerSetterForback to summary
public MethodDescription.InDefinedShape registerSetterFor(FieldDescription fieldDescription, MethodAccessorFactory.AccessType accessType)

Implements net.bytebuddy.implementation.MethodAccessorFactory.registerSetterFor.

Doc from net.bytebuddy.implementation.MethodAccessorFactory.registerSetterFor.

Registers a setter for the given FieldDescription which might itself not be accessible from outside the class. The returned setter method defines the field type as its only argument type, returns void and is of package-private visibility, similarly to the Java compiler's accessor methods. If the field is static, this accessor method is also static.

Parameters
fieldDescription:FieldDescription

The field which is to be accessed.

accessType:MethodAccessorFactory.AccessType

The required access type.

Returns:MethodDescription.InDefinedShape

A setter method for the given field.

valueOfback to summary
public static MethodAccessorFactory.Illegal valueOf(String name)
valuesback to summary
public static MethodAccessorFactory.Illegal[] values()