public static class ClassInjector.UsingLookup extends Object implements ClassInjector
A class injector that uses a java.lang.invoke.MethodHandles$Lookup
object for defining a class.
Important: This functionality is only available starting from Java 9.
Modifier and Type | Class and Description |
---|---|
protected static interface |
ClassInjector.UsingLookup.Dispatcher
A dispatcher for interacting with a method handle lookup.
|
ClassInjector.UsingInstrumentation, ClassInjector.UsingLookup, ClassInjector.UsingReflection, ClassInjector.UsingUnsafe
ALLOW_EXISTING_TYPES
Modifier | Constructor and Description |
---|---|
protected |
UsingLookup(Object lookup)
Creates a new class injector using a lookup instance.
|
Modifier and Type | Method and Description |
---|---|
Map<TypeDescription,Class<?>> |
inject(Map<? extends TypeDescription,byte[]> types)
Injects the given types into the represented class loader.
|
Class<?> |
lookupType()
Returns the lookup type this injector is based upon.
|
static ClassInjector.UsingLookup |
of(Object lookup)
Creates class injector that defines a class using a method handle lookup.
|
protected UsingLookup(Object lookup)
lookup
- The java.lang.invoke.MethodHandles$Lookup
instance to use.public static ClassInjector.UsingLookup of(Object lookup)
lookup
- The java.lang.invoke.MethodHandles$Lookup
instance to use.public Class<?> lookupType()
public Map<TypeDescription,Class<?>> inject(Map<? extends TypeDescription,byte[]> types)
ClassInjector
inject
in interface ClassInjector
types
- The types to load via injection.Copyright © 2014–2017. All rights reserved.