Package net.bytebuddy.dynamic.loading
Interface ClassInjector.UsingLookup.Dispatcher
-
- All Known Implementing Classes:
ClassInjector.UsingLookup.Dispatcher.ForJava9CapableVm
,ClassInjector.UsingLookup.Dispatcher.ForLegacyVm
- Enclosing class:
- ClassInjector.UsingLookup
protected static interface ClassInjector.UsingLookup.Dispatcher
A dispatcher for interacting with a method handle lookup.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ClassInjector.UsingLookup.Dispatcher.Creator
An action for defining a dispatcher.static class
ClassInjector.UsingLookup.Dispatcher.ForJava9CapableVm
A dispatcher for a Java 9 capable VM that supports class definition via method handles.static class
ClassInjector.UsingLookup.Dispatcher.ForLegacyVm
A dispatcher for a legacy VM that does not support class definition via method handles.
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Method Detail
-
isAlive
boolean isAlive()
Indicates if this dispatcher is available on the current VM.- Returns:
true
if this dispatcher is alive.
-
lookupType
java.lang.Class<?> lookupType(java.lang.Object lookup)
Returns the lookup type for a given method handle lookup.- Parameters:
lookup
- The lookup instance.- Returns:
- The lookup type.
-
lookupModes
int lookupModes(java.lang.Object lookup)
Returns a lookup objects lookup types.- Parameters:
lookup
- The lookup instance.- Returns:
- The modifiers indicating the instance's lookup modes.
-
resolve
java.lang.Object resolve(java.lang.Object lookup, java.lang.Class<?> type)
Resolves the supplied lookup instance's access scope for the supplied type.- Parameters:
lookup
- The lookup to use.type
- The type to resolve the scope for.- Returns:
- An appropriate lookup instance.
-
defineClass
java.lang.Class<?> defineClass(java.lang.Object lookup, byte[] binaryRepresentation)
Defines a class.- Parameters:
lookup
- Thejava.lang.invoke.MethodHandles$Lookup
instance to use.binaryRepresentation
- The defined class's binary representation.- Returns:
- The defined class.
-
-