Package net.bytebuddy.dynamic.loading
Enum ClassInjector.UsingLookup.Dispatcher.ForLegacyVm
- java.lang.Object
-
- java.lang.Enum<ClassInjector.UsingLookup.Dispatcher.ForLegacyVm>
-
- net.bytebuddy.dynamic.loading.ClassInjector.UsingLookup.Dispatcher.ForLegacyVm
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ClassInjector.UsingLookup.Dispatcher.ForLegacyVm>
,ClassInjector.UsingLookup.Dispatcher
- Enclosing interface:
- ClassInjector.UsingLookup.Dispatcher
public static enum ClassInjector.UsingLookup.Dispatcher.ForLegacyVm extends java.lang.Enum<ClassInjector.UsingLookup.Dispatcher.ForLegacyVm> implements ClassInjector.UsingLookup.Dispatcher
A dispatcher for a legacy VM that does not support class definition via method handles.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.loading.ClassInjector.UsingLookup.Dispatcher
ClassInjector.UsingLookup.Dispatcher.Creator, ClassInjector.UsingLookup.Dispatcher.ForJava9CapableVm, ClassInjector.UsingLookup.Dispatcher.ForLegacyVm
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
The singleton instance.
-
Constructor Summary
Constructors Modifier Constructor Description private
ForLegacyVm()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<?>
defineClass(java.lang.Object lookup, byte[] binaryRepresentation)
Defines a class.boolean
isAlive()
Indicates if this dispatcher is available on the current VM.int
lookupModes(java.lang.Object lookup)
Returns a lookup objects lookup types.java.lang.Class<?>
lookupType(java.lang.Object lookup)
Returns the lookup type for a given method handle lookup.java.lang.Object
resolve(java.lang.Object lookup, java.lang.Class<?> type)
Resolves the supplied lookup instance's access scope for the supplied type.static ClassInjector.UsingLookup.Dispatcher.ForLegacyVm
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ClassInjector.UsingLookup.Dispatcher.ForLegacyVm[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final ClassInjector.UsingLookup.Dispatcher.ForLegacyVm INSTANCE
The singleton instance.
-
-
Method Detail
-
values
public static ClassInjector.UsingLookup.Dispatcher.ForLegacyVm[] 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 (ClassInjector.UsingLookup.Dispatcher.ForLegacyVm c : ClassInjector.UsingLookup.Dispatcher.ForLegacyVm.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ClassInjector.UsingLookup.Dispatcher.ForLegacyVm 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
-
isAlive
public boolean isAlive()
Indicates if this dispatcher is available on the current VM.- Specified by:
isAlive
in interfaceClassInjector.UsingLookup.Dispatcher
- Returns:
true
if this dispatcher is alive.
-
lookupType
public java.lang.Class<?> lookupType(java.lang.Object lookup)
Returns the lookup type for a given method handle lookup.- Specified by:
lookupType
in interfaceClassInjector.UsingLookup.Dispatcher
- Parameters:
lookup
- The lookup instance.- Returns:
- The lookup type.
-
lookupModes
public int lookupModes(java.lang.Object lookup)
Returns a lookup objects lookup types.- Specified by:
lookupModes
in interfaceClassInjector.UsingLookup.Dispatcher
- Parameters:
lookup
- The lookup instance.- Returns:
- The modifiers indicating the instance's lookup modes.
-
resolve
public java.lang.Object resolve(java.lang.Object lookup, java.lang.Class<?> type)
Resolves the supplied lookup instance's access scope for the supplied type.- Specified by:
resolve
in interfaceClassInjector.UsingLookup.Dispatcher
- Parameters:
lookup
- The lookup to use.type
- The type to resolve the scope for.- Returns:
- An appropriate lookup instance.
-
defineClass
public java.lang.Class<?> defineClass(java.lang.Object lookup, byte[] binaryRepresentation)
Defines a class.- Specified by:
defineClass
in interfaceClassInjector.UsingLookup.Dispatcher
- Parameters:
lookup
- Thejava.lang.invoke.MethodHandles$Lookup
instance to use.binaryRepresentation
- The defined class's binary representation.- Returns:
- The defined class.
-
-