@HashCodeAndEqualsPlugin.Enhance public static class ClassLoadingStrategy.UsingLookup extends java.lang.Object implements ClassLoadingStrategy<java.lang.ClassLoader>
java.lang.invoke.MethodHandles$Lookup
instance for defining types.
A lookup instance can define types only in the same class loader and in the same package as the type within which
it was created. The supplied lookup must have package privileges, i.e. it must not be a public lookup.ClassLoadingStrategy.Configurable<S extends java.lang.ClassLoader>, ClassLoadingStrategy.Default, ClassLoadingStrategy.ForBootstrapInjection, ClassLoadingStrategy.ForUnsafeInjection, ClassLoadingStrategy.UsingLookup
Modifier and Type | Field and Description |
---|---|
private ClassInjector |
classInjector
The class injector to use.
|
BOOTSTRAP_LOADER, NO_PROTECTION_DOMAIN
Modifier | Constructor and Description |
---|---|
protected |
UsingLookup(ClassInjector classInjector)
Creates a new class loading strategy that uses a lookup type.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<TypeDescription,java.lang.Class<?>> |
load(java.lang.ClassLoader classLoader,
java.util.Map<TypeDescription,byte[]> types)
Loads a given collection of classes given their binary representation.
|
static ClassLoadingStrategy<java.lang.ClassLoader> |
of(java.lang.Object lookup)
Creates a new class loading strategy that uses a
java.lang.invoke.MethodHandles$Lookup instance. |
private final ClassInjector classInjector
protected UsingLookup(ClassInjector classInjector)
classInjector
- The class injector to use.public static ClassLoadingStrategy<java.lang.ClassLoader> of(java.lang.Object lookup)
java.lang.invoke.MethodHandles$Lookup
instance.lookup
- The lookup instance to use for defining new types.public java.util.Map<TypeDescription,java.lang.Class<?>> load(java.lang.ClassLoader classLoader, java.util.Map<TypeDescription,byte[]> types)
load
in interface ClassLoadingStrategy<java.lang.ClassLoader>
classLoader
- The class loader to used for loading the classes.types
- Byte array representations of the types to be loaded mapped by their descriptions,
where an iteration order defines an order in which they are supposed to be loaded,
if relevant.