@Module public class EnhancerManager extends java.lang.Object implements java.lang.instrument.ClassFileTransformer
Modifier and Type | Method and Description |
---|---|
void |
addClassEnhancer(ClassEnhancer classEnhancer)
Adds a class enhancer.
|
static EnhancerManager |
create() |
static EnhancerManager |
create(java.lang.ClassLoader loader) |
byte[] |
enhance(JClass jClass)
Enhances the given class.
|
JavaClassLoader |
getJavaClassLoader()
Returns the JClassLoader.
|
static EnhancerManager |
getLocalEnhancer(java.lang.ClassLoader loader) |
Path |
getPostWorkPath()
Gets the work path.
|
Path |
getPreWorkPath()
Gets the work path.
|
Path |
getWorkPath()
Gets the work path.
|
boolean |
isClassMatch(java.lang.String className)
Returns true for a matching class.
|
void |
setWorkPath(Path workPath)
Sets the work path.
|
java.lang.String |
toString() |
byte[] |
transform(java.lang.ClassLoader loader,
java.lang.String className,
java.lang.Class<?> oldClass,
java.security.ProtectionDomain domain,
byte[] buffer)
Returns the enhanced .class or null if no enhancement.
|
public static EnhancerManager create()
public static EnhancerManager create(java.lang.ClassLoader loader)
public static EnhancerManager getLocalEnhancer(java.lang.ClassLoader loader)
public JavaClassLoader getJavaClassLoader()
public Path getWorkPath()
public void setWorkPath(Path workPath)
public final Path getPreWorkPath()
public final Path getPostWorkPath()
public void addClassEnhancer(ClassEnhancer classEnhancer)
public byte[] transform(java.lang.ClassLoader loader, java.lang.String className, java.lang.Class<?> oldClass, java.security.ProtectionDomain domain, byte[] buffer)
transform
in interface java.lang.instrument.ClassFileTransformer
public byte[] enhance(JClass jClass) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public boolean isClassMatch(java.lang.String className)
public java.lang.String toString()
toString
in class java.lang.Object