Package net.bytebuddy.dynamic.loading
Class ClassInjector.UsingLookup.Dispatcher.ForJava9CapableVm
- java.lang.Object
-
- net.bytebuddy.dynamic.loading.ClassInjector.UsingLookup.Dispatcher.ForJava9CapableVm
-
- All Implemented Interfaces:
ClassInjector.UsingLookup.Dispatcher
- Enclosing interface:
- ClassInjector.UsingLookup.Dispatcher
public static class ClassInjector.UsingLookup.Dispatcher.ForJava9CapableVm extends java.lang.Object implements ClassInjector.UsingLookup.Dispatcher
A dispatcher for a Java 9 capable VM that supports 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
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedForJava9CapableVm(java.lang.reflect.Method lookupClass, java.lang.reflect.Method lookupModes, java.lang.reflect.Method dropLookupMode, java.lang.reflect.Method defineClass)Creates a new dispatcher for a Java 9 capable VM.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<?>defineClass(java.lang.Object lookup, byte[] binaryRepresentation)Defines a class.java.lang.ObjectdropLookupMode(java.lang.Object lookup, int mode)Drops a given lookup mode from a lookup instance.booleanisAlive()Indicates if this dispatcher is available on the current VM.intlookupModes(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.
-
-
-
Constructor Detail
-
ForJava9CapableVm
protected ForJava9CapableVm(java.lang.reflect.Method lookupClass, java.lang.reflect.Method lookupModes, java.lang.reflect.Method dropLookupMode, java.lang.reflect.Method defineClass)Creates a new dispatcher for a Java 9 capable VM.- Parameters:
lookupClass- Thejava.lang.invoke.MethodHandles$Lookup#lookupClassmethod.lookupModes- Thejava.lang.invoke.MethodHandles$Lookup#lookupModesmethod.dropLookupMode- Thejava.lang.invoke.MethodHandles$Lookup#dropLookupModemethod.defineClass- Thejava.lang.invoke.MethodHandles$Lookup#defineClassmethod.
-
-
Method Detail
-
isAlive
public boolean isAlive()
Description copied from interface:ClassInjector.UsingLookup.DispatcherIndicates if this dispatcher is available on the current VM.- Specified by:
isAlivein interfaceClassInjector.UsingLookup.Dispatcher- Returns:
trueif this dispatcher is alive.
-
lookupType
public java.lang.Class<?> lookupType(java.lang.Object lookup)
Description copied from interface:ClassInjector.UsingLookup.DispatcherReturns the lookup type for a given method handle lookup.- Specified by:
lookupTypein interfaceClassInjector.UsingLookup.Dispatcher- Parameters:
lookup- The lookup instance.- Returns:
- The lookup type.
-
lookupModes
public int lookupModes(java.lang.Object lookup)
Description copied from interface:ClassInjector.UsingLookup.DispatcherReturns a lookup objects lookup types.- Specified by:
lookupModesin interfaceClassInjector.UsingLookup.Dispatcher- Parameters:
lookup- The lookup instance.- Returns:
- The modifiers indicating the instance's lookup modes.
-
dropLookupMode
public java.lang.Object dropLookupMode(java.lang.Object lookup, int mode)Description copied from interface:ClassInjector.UsingLookup.DispatcherDrops a given lookup mode from a lookup instance.- Specified by:
dropLookupModein interfaceClassInjector.UsingLookup.Dispatcher- Parameters:
lookup- The lookup instance.mode- The modes to drop.- Returns:
- A new lookup instance where the modes were dropped.
-
defineClass
public java.lang.Class<?> defineClass(java.lang.Object lookup, byte[] binaryRepresentation)Description copied from interface:ClassInjector.UsingLookup.DispatcherDefines a class.- Specified by:
defineClassin interfaceClassInjector.UsingLookup.Dispatcher- Parameters:
lookup- Thejava.lang.invoke.MethodHandles$Lookupinstance to use.binaryRepresentation- The defined class's binary representation.- Returns:
- The defined class.
-
-