Package net.bytebuddy.dynamic.loading
Enum ClassInjector.UsingInstrumentation.Target
- java.lang.Object
-
- java.lang.Enum<ClassInjector.UsingInstrumentation.Target>
-
- net.bytebuddy.dynamic.loading.ClassInjector.UsingInstrumentation.Target
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ClassInjector.UsingInstrumentation.Target>
- Enclosing class:
- ClassInjector.UsingInstrumentation
public static enum ClassInjector.UsingInstrumentation.Target extends java.lang.Enum<ClassInjector.UsingInstrumentation.Target>
A representation of the target to which Java classes should be appended to.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ClassLoader
classLoader
The class loader to load classes from.
-
Constructor Summary
Constructors Modifier Constructor Description private
Target(java.lang.ClassLoader classLoader)
Creates a new injection target.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.lang.ClassLoader
getClassLoader()
Returns the class loader to load classes from.protected abstract void
inject(java.lang.instrument.Instrumentation instrumentation, java.util.jar.JarFile jarFile)
Adds the given classes to the represented class loader.static ClassInjector.UsingInstrumentation.Target
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ClassInjector.UsingInstrumentation.Target[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BOOTSTRAP
public static final ClassInjector.UsingInstrumentation.Target BOOTSTRAP
Representation of the bootstrap class loader.
-
SYSTEM
public static final ClassInjector.UsingInstrumentation.Target SYSTEM
Representation of the system class loader.
-
-
Method Detail
-
values
public static ClassInjector.UsingInstrumentation.Target[] 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 (ClassInjector.UsingInstrumentation.Target c : ClassInjector.UsingInstrumentation.Target.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ClassInjector.UsingInstrumentation.Target 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
-
getClassLoader
protected java.lang.ClassLoader getClassLoader()
Returns the class loader to load classes from.- Returns:
- The class loader to load classes from.
-
inject
protected abstract void inject(java.lang.instrument.Instrumentation instrumentation, java.util.jar.JarFile jarFile)
Adds the given classes to the represented class loader.- Parameters:
instrumentation
- The instrumentation instance to use.jarFile
- The jar file to append.
-
-