@HashCodeAndEqualsPlugin.Enhance public static class ClassLoadingStrategy.UsingLookup extends Object implements ClassLoadingStrategy<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 ClassLoader>, ClassLoadingStrategy.Default, ClassLoadingStrategy.ForBootstrapInjection, ClassLoadingStrategy.ForUnsafeInjection, ClassLoadingStrategy.UsingLookup
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 |
---|---|
Map<TypeDescription,Class<?>> |
load(ClassLoader classLoader,
Map<TypeDescription,byte[]> types)
Loads a given collection of classes given their binary representation.
|
static ClassLoadingStrategy<ClassLoader> |
of(Object lookup)
Creates a new class loading strategy that uses a
java.lang.invoke.MethodHandles$Lookup instance. |
protected UsingLookup(ClassInjector classInjector)
classInjector
- The class injector to use.public static ClassLoadingStrategy<ClassLoader> of(Object lookup)
java.lang.invoke.MethodHandles$Lookup
instance.lookup
- The lookup instance to use for defining new types.public Map<TypeDescription,Class<?>> load(ClassLoader classLoader, Map<TypeDescription,byte[]> types)
load
in interface ClassLoadingStrategy<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.Copyright © 2014–2018. All rights reserved.