void |
CtBehavior.addCatch(java.lang.String src,
CtClass exceptionType) |
Adds a catch clause that handles an exception thrown in the
body.
|
void |
CtBehavior.addCatch(java.lang.String src,
CtClass exceptionType,
java.lang.String exceptionName) |
Adds a catch clause that handles an exception thrown in the
body.
|
void |
CtClass.addConstructor(CtConstructor c) |
Adds a constructor.
|
void |
CtClass.addField(CtField f) |
Adds a field.
|
void |
CtClass.addField(CtField f,
java.lang.String init) |
Adds a field with an initial value.
|
void |
CtClass.addField(CtField f,
CtField.Initializer init) |
Adds a field with an initial value.
|
void |
CtBehavior.addLocalVariable(java.lang.String name,
CtClass type) |
Declares a new local variable.
|
void |
CtClass.addMethod(CtMethod m) |
Adds a method.
|
void |
CtBehavior.addParameter(CtClass type) |
Appends a new parameter, which becomes the last parameter.
|
void |
Loader.addTranslator(ClassPool cp,
Translator t) |
Adds a translator, which is called whenever a class is loaded.
|
static long |
SerialVersionUID.calculateDefault(CtClass clazz) |
Calculate default value.
|
boolean |
CtConstructor.callsSuper() |
Returns true if this constructor calls a constructor
of the super class.
|
static CtConstructor |
CtNewConstructor.copy(CtConstructor c,
CtClass declaring,
ClassMap map) |
Creates a copy of a constructor.
|
static CtMethod |
CtNewMethod.copy(CtMethod src,
java.lang.String name,
CtClass declaring,
ClassMap map) |
Creates a copy of a method with a new name.
|
static CtMethod |
CtNewMethod.copy(CtMethod src,
CtClass declaring,
ClassMap map) |
Creates a copy of a method.
|
static CtConstructor |
CtNewConstructor.defaultConstructor(CtClass declaring) |
Creates a default (public) constructor.
|
static CtMethod |
CtNewMethod.delegator(CtMethod delegate,
CtClass declaring) |
Creates a method forwarding to a delegate in
a super class.
|
static CtMethod |
CtNewMethod.getter(java.lang.String methodName,
CtField field) |
Creates a public getter method.
|
void |
CtBehavior.insertAfter(java.lang.String src) |
Inserts bytecode at the end of the body.
|
void |
CtBehavior.insertAfter(java.lang.String src,
boolean asFinally) |
Inserts bytecode at the end of the body.
|
void |
CtBehavior.insertAfter(java.lang.String src,
boolean asFinally,
boolean redundant) |
Inserts bytecode at the end of the body.
|
void |
CodeConverter.insertAfterMethod(CtMethod origMethod,
CtMethod afterMethod) |
Inserts a call to another method after an existing method call.
|
int |
CtBehavior.insertAt(int lineNum,
boolean modify,
java.lang.String src) |
Inserts bytecode at the specified line in the body.
|
int |
CtBehavior.insertAt(int lineNum,
java.lang.String src) |
Inserts bytecode at the specified line in the body.
|
void |
CtBehavior.insertBefore(java.lang.String src) |
Inserts bytecode at the beginning of the body.
|
void |
CtConstructor.insertBeforeBody(java.lang.String src) |
Inserts bytecode just after another constructor in the super class
or this class is called.
|
void |
CodeConverter.insertBeforeMethod(CtMethod origMethod,
CtMethod beforeMethod) |
Insert a call to another method before an existing method call.
|
void |
CtBehavior.insertParameter(CtClass type) |
Inserts a new parameter, which becomes the first parameter.
|
void |
CtBehavior.instrument(CodeConverter converter) |
Modifies the method/constructor body.
|
void |
CtBehavior.instrument(ExprEditor editor) |
Modifies the method/constructor body.
|
void |
CtClass.instrument(CodeConverter converter) |
Applies the given converter to all methods and constructors
declared in the class.
|
void |
CtClass.instrument(ExprEditor editor) |
Modifies the bodies of all methods and constructors
declared in the class.
|
java.lang.Class<?> |
Loader.Simple.invokeDefineClass(CtClass cc) |
Invokes the protected defineClass() in ClassLoader .
|
static CtField |
CtField.make(java.lang.String src,
CtClass declaring) |
Compiles the given source code and creates a field.
|
static CtMethod |
CtMethod.make(java.lang.String src,
CtClass declaring) |
Compiles the given source code and creates a method.
|
static CtMethod |
CtMethod.make(MethodInfo minfo,
CtClass declaring) |
Creates a method from a MethodInfo object.
|
static CtConstructor |
CtNewConstructor.make(java.lang.String src,
CtClass declaring) |
Compiles the given source code and creates a constructor.
|
static CtConstructor |
CtNewConstructor.make(CtClass[] parameters,
CtClass[] exceptions,
int howto,
CtMethod body,
CtMethod.ConstParameter cparam,
CtClass declaring) |
Creates a public constructor.
|
static CtConstructor |
CtNewConstructor.make(CtClass[] parameters,
CtClass[] exceptions,
java.lang.String body,
CtClass declaring) |
Creates a public constructor.
|
static CtConstructor |
CtNewConstructor.make(CtClass[] parameters,
CtClass[] exceptions,
CtClass declaring) |
Creates a public constructor that only calls a constructor
in the super class.
|
static CtMethod |
CtNewMethod.make(int modifiers,
CtClass returnType,
java.lang.String mname,
CtClass[] parameters,
CtClass[] exceptions,
java.lang.String body,
CtClass declaring) |
Creates a method.
|
static CtMethod |
CtNewMethod.make(java.lang.String src,
CtClass declaring) |
Compiles the given source code and creates a method.
|
static CtMethod |
CtNewMethod.make(java.lang.String src,
CtClass declaring,
java.lang.String delegateObj,
java.lang.String delegateMethod) |
Compiles the given source code and creates a method.
|
static CtMethod |
CtNewMethod.make(CtClass returnType,
java.lang.String mname,
CtClass[] parameters,
CtClass[] exceptions,
java.lang.String body,
CtClass declaring) |
Creates a public (non-static) method.
|
CtConstructor |
CtClass.makeClassInitializer() |
Makes an empty class initializer (static constructor).
|
void |
ClassPool.makePackage(java.lang.ClassLoader loader,
java.lang.String name) |
Deprecated.
|
void |
Translator.onLoad(ClassPool pool,
java.lang.String classname) |
Is invoked by a Loader for notifying that
a class is loaded.
|
void |
CodeConverter.redirectMethodCall(java.lang.String oldMethodName,
CtMethod newMethod) |
Correct invocations to a method that has been renamed.
|
void |
CodeConverter.redirectMethodCall(CtMethod origMethod,
CtMethod substMethod) |
Modify method invocations in a method body so that a different
method will be invoked.
|
void |
CtBehavior.setBody(java.lang.String src) |
Sets a method/constructor body.
|
void |
CtBehavior.setBody(java.lang.String src,
java.lang.String delegateObj,
java.lang.String delegateMethod) |
Sets a method/constructor body.
|
void |
CtConstructor.setBody(java.lang.String src) |
Sets a constructor body.
|
void |
CtConstructor.setBody(CtConstructor src,
ClassMap map) |
Copies a constructor body from another constructor.
|
void |
CtMethod.setBody(CtMethod src,
ClassMap map) |
Copies a method body from another method.
|
static void |
SerialVersionUID.setSerialVersionUID(CtClass clazz) |
Adds serialVersionUID if one does not already exist.
|
void |
CtClass.setSuperclass(CtClass clazz) |
Changes a super class unless this object represents an interface.
|
static CtMethod |
CtNewMethod.setter(java.lang.String methodName,
CtField field) |
Creates a public setter method.
|
void |
CtMethod.setWrappedBody(CtMethod mbody,
CtMethod.ConstParameter constParam) |
Replace a method body with a new method body wrapping the
given method.
|
static CtConstructor |
CtNewConstructor.skeleton(CtClass[] parameters,
CtClass[] exceptions,
CtClass declaring) |
Creates a public constructor that only calls a constructor
in the super class.
|
void |
Translator.start(ClassPool pool) |
Is invoked by a Loader for initialization
when the object is attached to the Loader object.
|
byte[] |
CtClass.toBytecode() |
Converts this class to a class file.
|
void |
CtClass.toBytecode(java.io.DataOutputStream out) |
Converts this class to a class file.
|
java.lang.Class |
ClassPool.toClass(CtClass clazz) |
Converts the given class to a java.lang.Class object.
|
java.lang.Class<?> |
ClassPool.toClass(CtClass ct,
java.lang.Class<?> neighbor) |
Converts the class to a java.lang.Class object.
|
java.lang.Class |
ClassPool.toClass(CtClass ct,
java.lang.Class<?> neighbor,
java.lang.ClassLoader loader,
java.security.ProtectionDomain domain) |
Converts the class to a java.lang.Class object.
|
java.lang.Class |
ClassPool.toClass(CtClass ct,
java.lang.ClassLoader loader) |
Deprecated.
|
java.lang.Class |
ClassPool.toClass(CtClass ct,
java.lang.ClassLoader loader,
java.security.ProtectionDomain domain) |
Deprecated.
|
java.lang.Class<?> |
ClassPool.toClass(CtClass ct,
java.lang.invoke.MethodHandles.Lookup lookup) |
Converts the class to a java.lang.Class object.
|
java.lang.Class<?> |
CtClass.toClass() |
Converts this class to a java.lang.Class object.
|
java.lang.Class<?> |
CtClass.toClass(java.lang.Class<?> neighbor) |
Converts this class to a java.lang.Class object.
|
java.lang.Class<?> |
CtClass.toClass(java.lang.ClassLoader loader) |
Deprecated.
|
java.lang.Class<?> |
CtClass.toClass(java.lang.ClassLoader loader,
java.security.ProtectionDomain domain) |
Converts this class to a java.lang.Class object.
|
java.lang.Class<?> |
CtClass.toClass(java.lang.invoke.MethodHandles.Lookup lookup) |
Converts this class to a java.lang.Class object.
|
CtMethod |
CtConstructor.toMethod(java.lang.String name,
CtClass declaring) |
Makes a copy of this constructor and converts it into a method.
|
CtMethod |
CtConstructor.toMethod(java.lang.String name,
CtClass declaring,
ClassMap map) |
Makes a copy of this constructor and converts it into a method.
|
void |
CtBehavior.useCflow(java.lang.String name) |
Declares to use $cflow for this method/constructor.
|
static CtMethod |
CtNewMethod.wrapped(CtClass returnType,
java.lang.String mname,
CtClass[] parameterTypes,
CtClass[] exceptionTypes,
CtMethod body,
CtMethod.ConstParameter constParam,
CtClass declaring) |
Creates a wrapped method.
|
void |
CtClass.writeFile() |
Writes a class file represented by this CtClass
object in the current directory.
|
void |
CtClass.writeFile(java.lang.String directoryName) |
Writes a class file represented by this CtClass
object on a local disk.
|