Package net.bytebuddy.dynamic.loading
Enum ClassLoadingStrategy.ForPreloadedTypes
- java.lang.Object
-
- java.lang.Enum<ClassLoadingStrategy.ForPreloadedTypes>
-
- net.bytebuddy.dynamic.loading.ClassLoadingStrategy.ForPreloadedTypes
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ClassLoadingStrategy.ForPreloadedTypes>
,ClassLoadingStrategy<java.lang.ClassLoader>
- Enclosing interface:
- ClassLoadingStrategy<T extends java.lang.ClassLoader>
public static enum ClassLoadingStrategy.ForPreloadedTypes extends java.lang.Enum<ClassLoadingStrategy.ForPreloadedTypes> implements ClassLoadingStrategy<java.lang.ClassLoader>
A class loading strategy that expects classes to already be available on the provided class loader. This strategy is mainly intended to work with Graal native images where classes cannot be loaded dynamically.
-
-
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.ForJnaInjection, ClassLoadingStrategy.ForPreloadedTypes, ClassLoadingStrategy.ForUnsafeInjection, ClassLoadingStrategy.UsingLookup
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
The singleton instance.
-
Field Summary
-
Fields inherited from interface net.bytebuddy.dynamic.loading.ClassLoadingStrategy
BOOTSTRAP_LOADER, NO_PROTECTION_DOMAIN
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ForPreloadedTypes()
-
Method Summary
All Methods Static 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.static ClassLoadingStrategy.ForPreloadedTypes
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ClassLoadingStrategy.ForPreloadedTypes[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final ClassLoadingStrategy.ForPreloadedTypes INSTANCE
The singleton instance.
-
-
Method Detail
-
values
public static ClassLoadingStrategy.ForPreloadedTypes[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ClassLoadingStrategy.ForPreloadedTypes c : ClassLoadingStrategy.ForPreloadedTypes.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ClassLoadingStrategy.ForPreloadedTypes valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
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.
-
-