@HashCodeAndEqualsPlugin.Enhance public static class ClassInjector.UsingLookup.Dispatcher.ForJava9CapableVm extends java.lang.Object implements ClassInjector.UsingLookup.Dispatcher
ClassInjector.UsingLookup.Dispatcher.Creator, ClassInjector.UsingLookup.Dispatcher.ForJava9CapableVm, ClassInjector.UsingLookup.Dispatcher.ForLegacyVm
Modifier and Type | Field and Description |
---|---|
private java.lang.reflect.Method |
defineClass
The
java.lang.invoke.MethodHandles$Lookup#defineClass method. |
private java.lang.reflect.Method |
dropLookupMode
The
java.lang.invoke.MethodHandles$Lookup#dropLookupMode method. |
private java.lang.reflect.Method |
lookupClass
The
java.lang.invoke.MethodHandles$Lookup#lookupClass method. |
private java.lang.reflect.Method |
lookupModes
The
java.lang.invoke.MethodHandles$Lookup#lookupModes method. |
private static java.lang.Object[] |
NO_ARGUMENTS
An empty array that can be used to indicate no arguments to avoid an allocation on a reflective call.
|
private java.lang.reflect.Method |
privateLookupIn
The
java.lang.invoke.MethodHandles$#privateLookupIn method. |
Modifier | Constructor and Description |
---|---|
protected |
ForJava9CapableVm(java.lang.reflect.Method privateLookupIn,
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.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Class<?> |
defineClass(java.lang.Object lookup,
byte[] binaryRepresentation)
Defines a class.
|
java.lang.Object |
dropLookupMode(java.lang.Object lookup,
int mode)
Drops a given lookup mode from a lookup instance.
|
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.
|
private static final java.lang.Object[] NO_ARGUMENTS
private final java.lang.reflect.Method privateLookupIn
java.lang.invoke.MethodHandles$#privateLookupIn
method.private final java.lang.reflect.Method lookupClass
java.lang.invoke.MethodHandles$Lookup#lookupClass
method.private final java.lang.reflect.Method lookupModes
java.lang.invoke.MethodHandles$Lookup#lookupModes
method.private final java.lang.reflect.Method dropLookupMode
java.lang.invoke.MethodHandles$Lookup#dropLookupMode
method.private final java.lang.reflect.Method defineClass
java.lang.invoke.MethodHandles$Lookup#defineClass
method.protected ForJava9CapableVm(java.lang.reflect.Method privateLookupIn, java.lang.reflect.Method lookupClass, java.lang.reflect.Method lookupModes, java.lang.reflect.Method dropLookupMode, java.lang.reflect.Method defineClass)
privateLookupIn
- The java.lang.invoke.MethodHandles$#privateLookupIn
method.lookupClass
- The java.lang.invoke.MethodHandles$Lookup#lookupClass
method.lookupModes
- The java.lang.invoke.MethodHandles$Lookup#lookupModes
method.dropLookupMode
- The java.lang.invoke.MethodHandles$Lookup#dropLookupMode
method.defineClass
- The java.lang.invoke.MethodHandles$Lookup#defineClass
method.public boolean isAlive()
isAlive
in interface ClassInjector.UsingLookup.Dispatcher
true
if this dispatcher is alive.public java.lang.Class<?> lookupType(java.lang.Object lookup)
lookupType
in interface ClassInjector.UsingLookup.Dispatcher
lookup
- The lookup instance.public int lookupModes(java.lang.Object lookup)
lookupModes
in interface ClassInjector.UsingLookup.Dispatcher
lookup
- The lookup instance.public java.lang.Object dropLookupMode(java.lang.Object lookup, int mode)
dropLookupMode
in interface ClassInjector.UsingLookup.Dispatcher
lookup
- The lookup instance.mode
- The modes to drop.public java.lang.Object resolve(java.lang.Object lookup, java.lang.Class<?> type)
resolve
in interface ClassInjector.UsingLookup.Dispatcher
lookup
- The lookup to use.type
- The type to resolve the scope for.public java.lang.Class<?> defineClass(java.lang.Object lookup, byte[] binaryRepresentation)
defineClass
in interface ClassInjector.UsingLookup.Dispatcher
lookup
- The java.lang.invoke.MethodHandles$Lookup
instance to use.binaryRepresentation
- The defined class's binary representation.