public abstract class AbstractProxyBytecodeTransformer extends Object implements ProxyBytecodeTransformer
INIT_FIELD_PREFIX| Constructor and Description |
|---|
AbstractProxyBytecodeTransformer(ClassPool classPool) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addInitCallToMethods(CtClass cc,
String clinitFieldName,
String initCall)
Adds the initCall as Java code to all the non static methods of the class.
|
protected void |
addStaticInitStateField(CtClass cc,
String clinitFieldName)
Adds a static boolean field to the class indicating the state of initialization
|
protected String |
generateRandomString() |
protected abstract String |
getInitCall(CtClass cc,
String random)
Builds the Java code String which should be executed to initialize the proxy
|
byte[] |
transform(byte[] byteCode) |
public AbstractProxyBytecodeTransformer(ClassPool classPool)
classPool - Classpool used to make a CtClasspublic byte[] transform(byte[] byteCode)
throws Exception
transform in interface ProxyBytecodeTransformerExceptionprotected abstract String getInitCall(CtClass cc, String random) throws Exception
cc - CtClass from new definitionrandom - randomly generated StringExceptionprotected String generateRandomString()
protected void addInitCallToMethods(CtClass cc, String clinitFieldName, String initCall) throws Exception
cc - CtClass to be modifiedclinitFieldName - field name in CtClassinitCall - Java code to initialize the ProxyExceptionCopyright © 2018. All rights reserved.