static CtMethod |
CtNewMethod.abstractMethod(CtClass returnType,
java.lang.String mname,
CtClass[] parameters,
CtClass[] exceptions,
CtClass declaring) |
Creates a public abstract method.
|
void |
Loader.addTranslator(ClassPool cp,
Translator t) |
Adds a translator, which is called whenever a class is loaded.
|
ClassPath |
ClassPool.appendClassPath(java.lang.String pathname) |
Appends a directory or a jar (or zip) file to the end of the
search path.
|
void |
ClassPool.appendPathList(java.lang.String pathlist) |
Appends directories and jar files for search.
|
static CtField.Initializer |
CtField.Initializer.byNewArray(CtClass type,
int size) |
Makes an initializer creating a new array.
|
CtClass |
ClassPool.get(java.lang.String classname) |
Reads a class file from the source and returns a reference
to the CtClass
object representing that class file.
|
CtClass[] |
ClassPool.get(java.lang.String[] classnames) |
Reads class files from the source and returns an array of
CtClass
objects representing those class files.
|
CtClass |
ClassPool.getAndRename(java.lang.String orgName,
java.lang.String newName) |
Reads a class file and constructs a CtClass
object with a new name.
|
CtClass |
CtClass.getComponentType() |
If this object represents an array, this method returns the component
type of the array.
|
CtConstructor |
CtClass.getConstructor(java.lang.String desc) |
Returns the constructor with the given signature,
which is represented by a character string
called method descriptor.
|
CtClass |
ClassPool.getCtClass(java.lang.String classname) |
Returns a CtClass object with the given name.
|
CtClass[] |
CtClass.getDeclaredClasses() |
Returns an array of nested classes declared in the class.
|
CtConstructor |
CtClass.getDeclaredConstructor(CtClass[] params) |
Returns a constructor receiving the specified parameters.
|
CtField |
CtClass.getDeclaredField(java.lang.String name) |
Retrieves the field with the specified name among the fields
declared in the class.
|
CtField |
CtClass.getDeclaredField(java.lang.String name,
java.lang.String desc) |
Retrieves the field with the specified name and type among the fields
declared in the class.
|
CtMethod |
CtClass.getDeclaredMethod(java.lang.String name) |
Retrieves the method with the specified name among the methods
declared in the class.
|
CtMethod |
CtClass.getDeclaredMethod(java.lang.String name,
CtClass[] params) |
Retrieves the method with the specified name and parameter types
among the methods declared in the class.
|
CtMethod[] |
CtClass.getDeclaredMethods(java.lang.String name) |
Retrieves methods with the specified name among the methods
declared in the class.
|
CtClass |
CtClass.getDeclaringClass() |
If this class is a member class or interface of another class,
then the class enclosing this class is returned.
|
CtBehavior |
CtClass.getEnclosingBehavior() |
Returns the immediately enclosing method of this class.
|
CtMethod |
CtClass.getEnclosingMethod() |
Deprecated.
|
CtClass[] |
CtBehavior.getExceptionTypes() |
Obtains exceptions that this method/constructor may throw.
|
CtField |
CtClass.getField(java.lang.String name) |
Returns the field with the specified name.
|
CtField |
CtClass.getField(java.lang.String name,
java.lang.String desc) |
Returns the field with the specified name and type.
|
CtClass[] |
CtClass.getInterfaces() |
Obtains the class objects representing the interfaces implemented
by the class or, if this object represents an interface, the interfaces
extended by that interface.
|
CtMethod |
ClassPool.getMethod(java.lang.String classname,
java.lang.String methodname) |
Reads a class file and obtains a compile-time method.
|
CtMethod |
CtClass.getMethod(java.lang.String name,
java.lang.String desc) |
Returns the method with the given name and signature.
|
CtClass[] |
CtClass.getNestedClasses() |
Returns an array of nested classes declared in the class.
|
CtClass[] |
CtBehavior.getParameterTypes() |
Obtains parameter types of this method/constructor.
|
CtClass |
CtMethod.getReturnType() |
Obtains the type of the returned value.
|
CtClass |
CtClass.getSuperclass() |
Obtains the class object representing the superclass of the
class.
|
CtClass |
CtField.getType() |
Returns the type of the field.
|
java.net.URL |
CtClass.getURL() |
Returns the uniform resource locator (URL) of the class file.
|
ClassPath |
ClassPool.insertClassPath(java.lang.String pathname) |
Inserts a directory or a jar (or zip) file at the head of the
search path.
|
void |
Translator.onLoad(ClassPool pool,
java.lang.String classname) |
Is invoked by a Loader for notifying that
a class is loaded.
|
java.io.InputStream |
ClassClassPath.openClassfile(java.lang.String classname) |
Obtains a class file by getResourceAsStream() .
|
java.io.InputStream |
ClassPath.openClassfile(java.lang.String classname) |
Opens a class file.
|
java.io.InputStream |
LoaderClassPath.openClassfile(java.lang.String classname) |
Obtains a class file from the class loader.
|
void |
CtClass.removeConstructor(CtConstructor c) |
Removes a constructor declared in this class.
|
void |
CtClass.removeField(CtField f) |
Removes a field declared in this class.
|
void |
CtClass.removeMethod(CtMethod m) |
Removes a method declared in this class.
|
void |
CodeConverter.replaceArrayAccess(CtClass calledClass,
CodeConverter.ArrayAccessReplacementMethodNames names) |
Modify a method body, so that ALL accesses to an array are replaced with
calls to static methods within another class.
|
void |
CtBehavior.setExceptionTypes(CtClass[] types) |
Sets exceptions that this method/constructor may throw.
|
static void |
SerialVersionUID.setSerialVersionUID(CtClass clazz) |
Adds serialVersionUID if one does not already exist.
|
void |
Translator.start(ClassPool pool) |
Is invoked by a Loader for initialization
when the object is attached to the Loader object.
|
boolean |
CtClass.subtypeOf(CtClass clazz) |
Returns true if this class extends or implements
clazz .
|
void |
CtClass.writeFile() |
Writes a class file represented by this CtClass
object in the current directory.
|