public interface ClassInjector
 A class injector is capable of injecting classes into a ClassLoader without
 requiring the class loader to being able to explicitly look up these classes.
 
 Important: Byte Buddy does not supply privileges when injecting code. When using a java.lang.SecurityManager,
 the user of this injector is responsible for providing access to non-public properties.
 
| Modifier and Type | Interface and Description | 
|---|---|
| static class  | ClassInjector.AbstractBaseAn abstract base implementation of a class injector. | 
| static class  | ClassInjector.UsingInstrumentationA class injector using a  Instrumentationto append to either the boot classpath
 or the system class path. | 
| static class  | ClassInjector.UsingJnaA class injector using JNA to invoke JNI's define class utility for defining a class. | 
| static class  | ClassInjector.UsingLookup
 A class injector that uses a  java.lang.invoke.MethodHandles$Lookupobject for defining a class. | 
| static class  | ClassInjector.UsingReflectionA class injector that uses reflective method calls. | 
| static class  | ClassInjector.UsingUnsafeA class injector that uses  sun.misc.Unsafeorjdk.internal.misc.Unsafeto inject classes. | 
| Modifier and Type | Field and Description | 
|---|---|
| static boolean | ALLOW_EXISTING_TYPESDetermines the default behavior for type injections when a type is already loaded. | 
| static Permission | SUPPRESS_ACCESS_CHECKSA permission for the  suppressAccessCheckspermission. | 
| Modifier and Type | Method and Description | 
|---|---|
| Map<TypeDescription,Class<?>> | inject(Map<? extends TypeDescription,byte[]> types)Injects the given types into the represented class loader. | 
| Map<String,Class<?>> | injectRaw(Map<? extends String,byte[]> types)Injects the given types into the represented class loader using a mapping from name to binary representation. | 
| boolean | isAlive()Indicates if this class injector is available on the current VM. | 
static final Permission SUPPRESS_ACCESS_CHECKS
suppressAccessChecks permission.static final boolean ALLOW_EXISTING_TYPES
boolean isAlive()
true if this injector is available on the current VM.Map<TypeDescription,Class<?>> inject(Map<? extends TypeDescription,byte[]> types)
types - The types to load via injection.Copyright © 2014–2024. All rights reserved.