| Package | Description |
|---|---|
| xapi.bytecode | |
| xapi.bytecode.annotation | |
| xapi.bytecode.attributes | |
| xapi.bytecode.impl |
| Modifier and Type | Class and Description |
|---|---|
class |
CtClassType |
class |
CtPrimitiveType |
| Modifier and Type | Field and Description |
|---|---|
static CtClass |
CtClass.booleanType
The
CtClass object representing
the boolean type. |
static CtClass |
CtClass.byteType
The
CtClass object representing
the byte type. |
static CtClass |
CtClass.charType
The
CtClass object representing
the char type. |
protected CtClass |
CtMember.declaringClass |
static CtClass |
CtClass.doubleType
The
CtClass object representing
the double type. |
static CtClass |
CtClass.floatType
The
CtClass object representing
the float type. |
static CtClass |
CtClass.intType
The
CtClass object representing
the int type. |
static CtClass |
CtClass.longType
The
CtClass object representing
the long type. |
static CtClass |
CtClass.shortType
The
CtClass object representing
the short type. |
static CtClass |
ConstPool.THIS
Represents the class using this constant pool table.
|
static CtClass |
Bytecode.THIS
Represents the
CtClass file using the
constant pool table given to this Bytecode object. |
static CtClass |
CtClass.voidType
The
CtClass object representing
the void type. |
| Modifier and Type | Field and Description |
|---|---|
protected Hashtable<String,CtClass> |
ClassPool.classes |
| Modifier and Type | Method and Description |
|---|---|
protected CtClass |
ClassPool.createCtClass(String classname,
boolean useCache)
Creates a CtClass object representing the specified class.
|
CtClass |
ClassPool.get(String classname)
Reads a class file from the source and returns a reference
to the
CtClass
object representing that class file. |
CtClass[] |
ClassPool.get(String[] classnames)
Reads class files from the source and returns an array of
CtClass
objects representing those class files. |
protected CtClass |
ClassPool.get0(String classname,
boolean useCache) |
CtClass |
ClassPool.getAndRename(String orgName,
String newName)
Reads a class file and constructs a
CtClass
object with a new name. |
protected CtClass |
ClassPool.getCached(String classname)
Provide a hook so that subclasses can do their own
caching of classes.
|
CtClass |
CtClass.getComponentType()
If this object represents an array, this method returns the component
type of the array.
|
CtClass |
ClassPool.getCtClass(String classname)
Returns a
CtClass object with the given name. |
CtClass |
CtMember.getDeclaringClass()
Returns the class that declares this member.
|
CtClass |
CtField.getDeclaringClass()
Returns the class declaring the field.
|
CtClass |
CtClassType.getDeclaringClass() |
CtClass |
CtClass.getDeclaringClass()
If this class is a member class or interface of another class,
then the class enclosing this class is returned.
|
CtClass[] |
CtBehavior.getExceptionTypes()
Obtains exceptions that this method/constructor may throw.
|
CtClass[] |
CtClassType.getInterfaces() |
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.
|
CtClass[] |
CtClassType.getNestedClasses() |
CtClass[] |
CtClass.getNestedClasses()
Returns an array of nested classes declared in the class.
|
CtClass |
ClassPool.getOrNull(String classname)
Reads a class file from the source and returns a reference
to the
CtClass
object representing that class file. |
CtClass[] |
CtBehavior.getParameterTypes()
Obtains parameter types of this method/constructor.
|
static CtClass[] |
Descriptor.getParameterTypes(String desc,
ClassPool cp)
Returns the
CtClass objects representing the parameter
types specified by the given descriptor. |
CtClass |
CtMethod.getReturnType()
Obtains the type of the returned value.
|
static CtClass |
Descriptor.getReturnType(String desc,
ClassPool cp)
Returns the
CtClass object representing the return
type specified by the given descriptor. |
CtClass |
CtClassType.getSuperclass() |
CtClass |
CtClass.getSuperclass()
Obtains the class object representing the superclass of the
class.
|
CtClass |
CtField.getType()
Returns the type of the field.
|
CtClass |
ClassPool.makeClass(InputStream classfile)
Creates a new class (or interface) from the given class file.
|
CtClass |
ClassPool.makeClass(InputStream classfile,
boolean ifNotFrozen)
Creates a new class (or interface) from the given class file.
|
CtClass |
ClassPool.makeClass(String classname)
Creates a new public class.
|
CtClass |
ClassPool.makeClass(String classname,
CtClass superclass)
Creates a new public class.
|
CtClass |
ClassPool.makeClassIfNew(InputStream classfile)
Creates a new class (or interface) from the given class file.
|
CtClass |
ClassPool.makeInterface(String name)
Creates a new public interface.
|
CtClass |
ClassPool.makeInterface(String name,
CtClass superclass)
Creates a new public interface.
|
CtClass |
CtClassType.makeNestedClass(String name,
boolean isStatic) |
CtClass |
CtClass.makeNestedClass(String name,
boolean isStatic)
Makes a new public nested class.
|
protected CtClass |
ClassPool.removeCached(String classname)
Provide a hook so that subclasses can do their own
caching of classes.
|
static CtClass |
Descriptor.toCtClass(String desc,
ClassPool cp)
Returns a
CtClass object representing the type
specified by the given descriptor. |
static CtClass |
Descriptor.toPrimitiveClass(char c) |
| Modifier and Type | Method and Description |
|---|---|
void |
Bytecode.addAnewarray(CtClass clazz,
int length)
Appends ICONST and ANEWARRAY.
|
void |
Bytecode.addCheckcast(CtClass c)
Appends CHECKCAST.
|
int |
ConstPool.addClassInfo(CtClass c)
Adds a new
CONSTANT_Class_info structure. |
void |
Bytecode.addConstZero(CtClass type)
Appends an instruction for pushing zero or null on the stack.
|
void |
Bytecode.addExceptionHandler(int start,
int end,
int handler,
CtClass type)
Adds a new entry of
exception_table. |
void |
Bytecode.addGetfield(CtClass c,
String name,
String type)
Appends GETFIELD.
|
void |
Bytecode.addGetstatic(CtClass c,
String name,
String type)
Appends GETSTATIC.
|
void |
CtClassType.addInterface(CtClass anInterface) |
void |
CtClass.addInterface(CtClass anInterface)
Adds an interface.
|
void |
Bytecode.addInvokeinterface(CtClass clazz,
String name,
CtClass returnType,
CtClass[] paramTypes,
int count)
Appends INVOKEINTERFACE.
|
void |
Bytecode.addInvokeinterface(CtClass clazz,
String name,
CtClass returnType,
CtClass[] paramTypes,
int count)
Appends INVOKEINTERFACE.
|
void |
Bytecode.addInvokeinterface(CtClass clazz,
String name,
String desc,
int count)
Appends INVOKEINTERFACE.
|
void |
Bytecode.addInvokespecial(CtClass clazz,
String name,
CtClass returnType,
CtClass[] paramTypes)
Appends INVOKESPECIAL.
|
void |
Bytecode.addInvokespecial(CtClass clazz,
String name,
CtClass returnType,
CtClass[] paramTypes)
Appends INVOKESPECIAL.
|
void |
Bytecode.addInvokespecial(CtClass clazz,
String name,
String desc)
Appends INVOKESPECIAL.
|
void |
Bytecode.addInvokestatic(CtClass clazz,
String name,
CtClass returnType,
CtClass[] paramTypes)
Appends INVOKESTATIC.
|
void |
Bytecode.addInvokestatic(CtClass clazz,
String name,
CtClass returnType,
CtClass[] paramTypes)
Appends INVOKESTATIC.
|
void |
Bytecode.addInvokestatic(CtClass clazz,
String name,
String desc)
Appends INVOKESTATIC.
|
void |
Bytecode.addInvokevirtual(CtClass clazz,
String name,
CtClass returnType,
CtClass[] paramTypes)
Appends INVOKEVIRTUAL.
|
void |
Bytecode.addInvokevirtual(CtClass clazz,
String name,
CtClass returnType,
CtClass[] paramTypes)
Appends INVOKEVIRTUAL.
|
void |
Bytecode.addInvokevirtual(CtClass clazz,
String name,
String desc)
Appends INVOKEVIRTUAL.
|
int |
Bytecode.addLoad(int n,
CtClass type)
Appends an instruction for loading a value from the
local variable at the index
n. |
int |
Bytecode.addLoadParameters(CtClass[] params,
int offset)
Appends instructions for loading all the parameters onto the
operand stack.
|
void |
CtBehavior.addLocalVariable(String name,
CtClass type)
Declares a new local variable.
|
int |
Bytecode.addMultiNewarray(CtClass clazz,
int dim)
Appends MULTINEWARRAY.
|
int |
Bytecode.addMultiNewarray(CtClass clazz,
int[] dimensions)
Appends MULTINEWARRAY.
|
void |
Bytecode.addNew(CtClass clazz)
Appends NEW.
|
void |
CtBehavior.addParameter(CtClass type)
Appends a new parameter, which becomes the last parameter.
|
void |
Bytecode.addPutfield(CtClass c,
String name,
String desc)
Appends PUTFIELD.
|
void |
Bytecode.addPutstatic(CtClass c,
String name,
String desc)
Appends PUTSTATIC.
|
void |
Bytecode.addReturn(CtClass type)
Appends ARETURN, IRETURN, .., or RETURN.
|
int |
Bytecode.addStore(int n,
CtClass type)
Appends an instruction for storing a value into the
local variable at the index
n. |
static String |
Descriptor.appendParameter(CtClass type,
String descriptor)
Appends a parameter type to the parameter list represented
by the given descriptor.
|
protected void |
ClassPool.cacheCtClass(String classname,
CtClass c,
boolean dynamic)
Provides a hook so that subclasses can do their own
caching of classes.
|
static CtConstructor |
CtNewConstructor.copy(CtConstructor c,
CtClass declaring,
ClassMap map)
Creates a copy of a constructor.
|
static CtConstructor |
CtNewConstructor.defaultConstructor(CtClass declaring)
Creates a default (public) constructor.
|
void |
ClassMap.fix(CtClass clazz)
Prevents a mapping from the specified class name to another name.
|
CtConstructor |
CtClass.getDeclaredConstructor(CtClass[] params)
Returns a constructor receiving the specified parameters.
|
CtMethod |
CtClassType.getDeclaredMethod(String name,
CtClass[] params) |
CtMethod |
CtClass.getDeclaredMethod(String name,
CtClass[] params)
Retrieves the method with the specified name and parameter types
among the methods declared in the class.
|
void |
CtBehavior.insertParameter(CtClass type)
Inserts a new parameter, which becomes the first parameter.
|
static String |
Descriptor.insertParameter(CtClass type,
String descriptor)
Inserts a parameter type at the beginning of the parameter
list represented
by the given descriptor.
|
static CtConstructor |
CtNewConstructor.make(CtClass[] parameters,
CtClass[] exceptions,
String body,
CtClass declaring)
Creates a public constructor.
|
static CtConstructor |
CtNewConstructor.make(CtClass[] parameters,
CtClass[] exceptions,
String body,
CtClass declaring)
Creates a public constructor.
|
static CtConstructor |
CtNewConstructor.make(CtClass[] parameters,
CtClass[] exceptions,
String body,
CtClass declaring)
Creates a public constructor.
|
static CtMethod |
CtMethod.make(MethodInfo minfo,
CtClass declaring)
Creates a method from a
MethodInfo object. |
CtClass |
ClassPool.makeClass(String classname,
CtClass superclass)
Creates a new public class.
|
CtClass |
ClassPool.makeInterface(String name,
CtClass superclass)
Creates a new public interface.
|
static String |
Descriptor.of(CtClass type)
Returns the descriptor representing the given type.
|
static String |
Descriptor.ofConstructor(CtClass[] paramTypes)
Returns the descriptor representing a constructor receiving
the given parameter types.
|
static String |
Descriptor.ofMethod(CtClass returnType,
CtClass[] paramTypes)
Returns the descriptor representing a method that receives
the given parameter types and returns the given type.
|
static String |
Descriptor.ofMethod(CtClass returnType,
CtClass[] paramTypes)
Returns the descriptor representing a method that receives
the given parameter types and returns the given type.
|
static String |
Descriptor.ofParameters(CtClass[] paramTypes)
Returns the descriptor representing a list of parameter types.
|
void |
ClassMap.put(CtClass oldname,
CtClass newname)
Maps a class name to another name in this hashtable.
|
void |
CtBehavior.setExceptionTypes(CtClass[] types)
Sets exceptions that this method/constructor may throw.
|
void |
CtClassType.setInterfaces(CtClass[] list) |
void |
CtClass.setInterfaces(CtClass[] list)
Sets implemented interfaces.
|
void |
Bytecode.setMaxLocals(boolean isStatic,
CtClass[] params,
int locals)
Sets
max_locals. |
void |
CtClassType.setSuperclass(CtClass clazz) |
void |
CtClass.setSuperclass(CtClass clazz)
Changes a super class unless this object represents an interface.
|
void |
CtField.setType(CtClass clazz)
Sets the type of the field.
|
boolean |
CtClassType.subclassOf(CtClass superclass) |
boolean |
CtClass.subclassOf(CtClass superclass)
Determines whether the class directly or indirectly extends
the given class.
|
boolean |
CtClassType.subtypeOf(CtClass clazz) |
boolean |
CtClass.subtypeOf(CtClass clazz)
Returns
true if this class extends or implements
clazz. |
static String |
Descriptor.toJvmName(CtClass clazz)
Returns the internal representation of the class name in the
JVM.
|
CtMethod |
CtConstructor.toMethod(String name,
CtClass declaring)
Makes a copy of this constructor and converts it into a method.
|
CtMethod |
CtConstructor.toMethod(String name,
CtClass declaring,
ClassMap map)
Makes a copy of this constructor and converts it into a method.
|
boolean |
CtMember.visibleFrom(CtClass clazz)
Returns true if this member is accessible from the given class.
|
| Constructor and Description |
|---|
CtBehavior(CtClass clazz,
MethodInfo minfo) |
CtConstructor(CtClass[] parameters,
CtClass declaring)
Creates a constructor with no constructor body.
|
CtConstructor(CtClass[] parameters,
CtClass declaring)
Creates a constructor with no constructor body.
|
CtConstructor(CtConstructor src,
CtClass declaring,
ClassMap map)
Creates a copy of a
CtConstructor object. |
CtConstructor(MethodInfo minfo,
CtClass declaring) |
CtField(CtClass type,
String name,
CtClass declaring)
Creates a
CtField object. |
CtField(CtField src,
CtClass declaring)
Creates a copy of the given field.
|
CtMember(CtClass clazz) |
CtMethod(CtClass returnType,
String mname,
CtClass[] parameters,
CtClass declaring)
Creates a public abstract method.
|
CtMethod(CtClass returnType,
String mname,
CtClass[] parameters,
CtClass declaring)
Creates a public abstract method.
|
| Modifier and Type | Method and Description |
|---|---|
static MemberValue |
Annotation.createMemberValue(ConstPool cp,
CtClass type)
Makes an instance of
MemberValue. |
| Constructor and Description |
|---|
Annotation(ConstPool cp,
CtClass clazz)
Constructs an annotation that can be accessed through the interface
represented by
clazz. |
| Modifier and Type | Method and Description |
|---|---|
CtClass |
SignatureAttribute.BaseType.getCtlass()
Returns the
CtClass representing this
primitive type. |
| Modifier and Type | Method and Description |
|---|---|
IsType[] |
BytecodeAdapterService.toTypes(CtClass[] parameterTypes) |
Copyright © December 07, 2012–2015 The Internet Party. All rights reserved.