Package net.bytebuddy
Class ByteBuddy.EnumerationImplementation
- java.lang.Object
-
- net.bytebuddy.ByteBuddy.EnumerationImplementation
-
- All Implemented Interfaces:
InstrumentedType.Prepareable,Implementation
- Enclosing class:
- ByteBuddy
@Enhance protected static class ByteBuddy.EnumerationImplementation extends java.lang.Object implements Implementation
An implementation fo thevaluesmethod of an enumeration type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classByteBuddy.EnumerationImplementation.InitializationAppenderA byte code appender for the type initializer of any enumeration type.protected static classByteBuddy.EnumerationImplementation.ValuesMethodAppenderA byte code appender for thevaluesmethod of any enumeration type.-
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 Modifier and Type Field Description protected static java.lang.StringCLONE_METHOD_NAMEThe name of theObject.clone()method.private static intENUM_FIELD_MODIFIERSThe field modifiers to use for any field that is added to an enumeration.protected static java.lang.StringENUM_VALUE_OF_METHOD_NAMEThe name of thevalueOfmethod that is defined for any enumeration.private static java.lang.StringENUM_VALUESThe name of the field containing an array of all enumeration values.protected static java.lang.StringENUM_VALUES_METHOD_NAMEThe name of thevaluesmethod that is defined for any enumeration.private java.util.List<java.lang.String>valuesThe names of the enumerations to define for the enumeration.
-
Constructor Summary
Constructors Modifier Constructor Description protectedEnumerationImplementation(java.util.List<java.lang.String> values)Creates a new implementation of an enumeration type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteCodeAppenderappender(Implementation.Target implementationTarget)Creates a byte code appender that determines the implementation of the instrumented type's methods.InstrumentedTypeprepare(InstrumentedType instrumentedType)Prepares a given instrumented type.
-
-
-
Field Detail
-
CLONE_METHOD_NAME
protected static final java.lang.String CLONE_METHOD_NAME
The name of theObject.clone()method.- See Also:
- Constant Field Values
-
ENUM_VALUE_OF_METHOD_NAME
protected static final java.lang.String ENUM_VALUE_OF_METHOD_NAME
The name of thevalueOfmethod that is defined for any enumeration.- See Also:
- Constant Field Values
-
ENUM_VALUES_METHOD_NAME
protected static final java.lang.String ENUM_VALUES_METHOD_NAME
The name of thevaluesmethod that is defined for any enumeration.- See Also:
- Constant Field Values
-
ENUM_FIELD_MODIFIERS
private static final int ENUM_FIELD_MODIFIERS
The field modifiers to use for any field that is added to an enumeration.- See Also:
- Constant Field Values
-
ENUM_VALUES
private static final java.lang.String ENUM_VALUES
The name of the field containing an array of all enumeration values.- See Also:
- Constant Field Values
-
values
private final java.util.List<java.lang.String> values
The names of the enumerations to define for the enumeration.
-
-
Method Detail
-
prepare
public InstrumentedType prepare(InstrumentedType instrumentedType)
Prepares a given instrumented type.- Specified by:
preparein interfaceInstrumentedType.Prepareable- Parameters:
instrumentedType- The instrumented type in its current form.- Returns:
- The prepared instrumented type.
-
appender
public ByteCodeAppender appender(Implementation.Target implementationTarget)
Creates a byte code appender that determines the implementation of the instrumented type's methods.- Specified by:
appenderin 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).
-
-