Package net.bytebuddy.dynamic.loading
Class ClassLoadingStrategy.ForBootstrapInjection
- java.lang.Object
-
- net.bytebuddy.dynamic.loading.ClassLoadingStrategy.ForBootstrapInjection
-
- All Implemented Interfaces:
ClassLoadingStrategy<java.lang.ClassLoader>
- Enclosing interface:
- ClassLoadingStrategy<T extends java.lang.ClassLoader>
@Enhance public static class ClassLoadingStrategy.ForBootstrapInjection extends java.lang.Object implements ClassLoadingStrategy<java.lang.ClassLoader>
A class loading strategy which allows class injection into the bootstrap class loader if appropriate.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.loading.ClassLoadingStrategy
ClassLoadingStrategy.Configurable<S extends java.lang.ClassLoader>, ClassLoadingStrategy.Default, ClassLoadingStrategy.ForBootstrapInjection, ClassLoadingStrategy.ForUnsafeInjection, ClassLoadingStrategy.UsingLookup
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.File
folder
The folder to save jar files in.private java.lang.instrument.Instrumentation
instrumentation
The instrumentation to use.-
Fields inherited from interface net.bytebuddy.dynamic.loading.ClassLoadingStrategy
BOOTSTRAP_LOADER, NO_PROTECTION_DOMAIN
-
-
Constructor Summary
Constructors Constructor Description ForBootstrapInjection(java.lang.instrument.Instrumentation instrumentation, java.io.File folder)
Creates a new injector which is capable of injecting classes into the bootstrap class loader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
ForBootstrapInjection
public ForBootstrapInjection(java.lang.instrument.Instrumentation instrumentation, java.io.File folder)
Creates a new injector which is capable of injecting classes into the bootstrap class loader.- Parameters:
instrumentation
- The instrumentation to use.folder
- The folder to save jar files in.
-
-
Method Detail
-
load
public 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.- Specified by:
load
in interfaceClassLoadingStrategy<java.lang.ClassLoader>
- Parameters:
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.- Returns:
- A collection of the loaded classes which will be initialized in the iteration order of the returned collection.
-
-