Package net.bytebuddy.implementation
Enum MethodAccessorFactory.Illegal
- java.lang.Object
-
- java.lang.Enum<MethodAccessorFactory.Illegal>
-
- net.bytebuddy.implementation.MethodAccessorFactory.Illegal
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<MethodAccessorFactory.Illegal>
,MethodAccessorFactory
- Enclosing interface:
- MethodAccessorFactory
public static enum MethodAccessorFactory.Illegal extends java.lang.Enum<MethodAccessorFactory.Illegal> implements MethodAccessorFactory
A method accessor factory that forbids any accessor registration.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.MethodAccessorFactory
MethodAccessorFactory.AccessType, MethodAccessorFactory.Illegal
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
The singleton instance.
-
Constructor Summary
Constructors Modifier Constructor Description private
Illegal()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodDescription.InDefinedShape
registerAccessorFor(Implementation.SpecialMethodInvocation specialMethodInvocation, MethodAccessorFactory.AccessType accessType)
Registers an accessor method for aImplementation.SpecialMethodInvocation
which cannot itself be triggered invoked directly from outside a type.MethodDescription.InDefinedShape
registerGetterFor(FieldDescription fieldDescription, MethodAccessorFactory.AccessType accessType)
Registers a getter for the givenFieldDescription
which might itself not be accessible from outside the class.MethodDescription.InDefinedShape
registerSetterFor(FieldDescription fieldDescription, MethodAccessorFactory.AccessType accessType)
Registers a setter for the givenFieldDescription
which might itself not be accessible from outside the class.static MethodAccessorFactory.Illegal
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static MethodAccessorFactory.Illegal[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final MethodAccessorFactory.Illegal INSTANCE
The singleton instance.
-
-
Method Detail
-
values
public static MethodAccessorFactory.Illegal[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (MethodAccessorFactory.Illegal c : MethodAccessorFactory.Illegal.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MethodAccessorFactory.Illegal valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
registerAccessorFor
public MethodDescription.InDefinedShape registerAccessorFor(Implementation.SpecialMethodInvocation specialMethodInvocation, MethodAccessorFactory.AccessType accessType)
Registers an accessor method for aImplementation.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.- Specified by:
registerAccessorFor
in interfaceMethodAccessorFactory
- Parameters:
specialMethodInvocation
- The special method invocation.accessType
- The required access type.- Returns:
- The accessor method for invoking the special method invocation.
-
registerGetterFor
public MethodDescription.InDefinedShape registerGetterFor(FieldDescription fieldDescription, MethodAccessorFactory.AccessType accessType)
Registers a getter for the givenFieldDescription
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 isstatic
, this accessor method is alsostatic
.- Specified by:
registerGetterFor
in interfaceMethodAccessorFactory
- Parameters:
fieldDescription
- The field which is to be accessed.accessType
- The required access type.- Returns:
- A getter method for the given field.
-
registerSetterFor
public MethodDescription.InDefinedShape registerSetterFor(FieldDescription fieldDescription, MethodAccessorFactory.AccessType accessType)
Registers a setter for the givenFieldDescription
which might itself not be accessible from outside the class. The returned setter method defines the field type as its only argument type, returnsvoid
and is of package-private visibility, similarly to the Java compiler's accessor methods. If the field isstatic
, this accessor method is alsostatic
.- Specified by:
registerSetterFor
in interfaceMethodAccessorFactory
- Parameters:
fieldDescription
- The field which is to be accessed.accessType
- The required access type.- Returns:
- A setter method for the given field.
-
-