Class JavassistClassBytecodeProcessor
java.lang.Object
org.zeroturnaround.javarebel.integration.support.JavassistClassBytecodeProcessor
- All Implemented Interfaces:
org.zeroturnaround.javarebel.ClassBytecodeProcessor
- Direct Known Subclasses:
CacheAwareJavassistClassBytecodeProcessor,CBPs.DelayedProcessor
public abstract class JavassistClassBytecodeProcessor
extends Object
implements org.zeroturnaround.javarebel.ClassBytecodeProcessor
Javassist-based bytecode processor callback.
Any sub class is required to implement the
process(ClassPool, ClassLoader, CtClass) method.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptPathAsClass(String classname) Says to javassist if the path can even be a class name.booleanacceptPathAsPrimitive(String classname) intpriority()byte[]process(ClassLoader cl, String name, byte[] bytecode) protected byte[]process(org.zeroturnaround.bundled.javassist.ClassPool cp, ClassLoader cl, String classname, byte[] bytecode) abstract voidprocess(org.zeroturnaround.bundled.javassist.ClassPool cp, ClassLoader cl, org.zeroturnaround.bundled.javassist.CtClass ctClass) Modifies the class to be loaded.voidsetImplicitClassNames(Map<String, String> implicitClassNames) Can modify the class name request from javassist.Avoids duplicate patching a given class when it has already been patched.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.zeroturnaround.javarebel.ClassBytecodeProcessor
process
-
Constructor Details
-
JavassistClassBytecodeProcessor
public JavassistClassBytecodeProcessor()
-
-
Method Details
-
process
- Specified by:
processin interfaceorg.zeroturnaround.javarebel.ClassBytecodeProcessor
-
priority
public int priority()- Specified by:
priorityin interfaceorg.zeroturnaround.javarebel.ClassBytecodeProcessor
-
process
protected byte[] process(org.zeroturnaround.bundled.javassist.ClassPool cp, ClassLoader cl, String classname, byte[] bytecode) throws Exception - Throws:
Exception
-
setImplicitClassNames
Can modify the class name request from javassist. Used to improve performance to skip pointless name checks. -
acceptPathAsClass
Says to javassist if the path can even be a class name. Used to improve performance to skip pointless name checks. -
acceptPathAsPrimitive
-
process
public abstract void process(org.zeroturnaround.bundled.javassist.ClassPool cp, ClassLoader cl, org.zeroturnaround.bundled.javassist.CtClass ctClass) throws Exception Modifies the class to be loaded.- Parameters:
cp- the container ofCtClassobjects.cl- the class loader loading the given class.ctClass- the class representation.- Throws:
Exception
-
withDuplicatePatchingProtection
Avoids duplicate patching a given class when it has already been patched. The mechanism for checking this is to add a field to the class with a comma-separated list of CBP names that have been applied to the class and to check this list for a match before running the cbp.
-