|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--gnu.bytecode.Type
|
+--gnu.bytecode.ObjectType
|
+--gnu.bytecode.ClassType
| Field Summary | |
int |
access_flags
|
Method |
constructor
|
static int |
major_version
|
static int |
minor_version
|
| Fields inherited from class gnu.bytecode.Type |
boolean_ctype,
boolean_type,
booleanValue_method,
byte_type,
char_type,
double_type,
doubleValue_method,
float_type,
floatValue_method,
int_type,
intValue_method,
long_type,
longValue_method,
number_type,
pointer_type,
reflectClass,
short_type,
string_type,
throwable_type,
toString_method,
typeArray0,
void_type |
| Constructor Summary | |
ClassType()
|
|
ClassType(java.lang.String class_name)
|
|
| Method Summary | |
Field |
addField()
Add a new field to this class. |
Field |
addField(java.lang.String name)
Add a new field to this class, and name the field. |
Field |
addField(java.lang.String name,
Type type)
|
Field |
addField(java.lang.String name,
Type type,
int flags)
|
void |
addFields()
Use reflection to add all the declared fields of this class. |
void |
addInterface(ClassType newInterface)
Add an interface to the list of implemented interfaces. |
Method |
addMethod(java.lang.String name)
|
Method |
addMethod(java.lang.String name,
int flags)
|
Method |
addMethod(java.lang.String name,
int flags,
Type[] arg_types,
Type return_type)
Add a method to this ClassType. |
Method |
addMethod(java.lang.String name,
java.lang.String signature,
int flags)
|
Method |
addMethod(java.lang.String name,
Type[] arg_types,
Type return_type,
int flags)
|
void |
addMethods(java.lang.Class clas)
Use reflection to add all the declared methods of this class. |
int |
compare(Type other)
Return a numeric code showing "subtype" relationship: 1: if other is a pure subtype of this; 0: if has the same members; -1: if this is a pure subtype of other; -2: if both a member in common but neither is a subtype of the other; -3: if the types have no values in common. |
void |
doFixups()
Do various fixups after generating code but before we can write it out. |
Attribute |
getAttributes()
Get the (first) Attribute of this container. |
CpoolEntry |
getConstant(int i)
|
ConstantPool |
getConstants()
|
Field |
getDeclaredField(java.lang.String name)
Find a field with the given name declared in this class. |
Method |
getDeclaredMethod(java.lang.String name,
int argCount)
Get a method with matching name and number of arguments. |
Method |
getDeclaredMethod(java.lang.String name,
Type[] arg_types)
|
Field |
getField(java.lang.String name)
Find a field with the given name declared in this class or its ancestors. |
int |
getFieldCount()
|
Field |
getFields()
Get the fields of this class. |
ClassType[] |
getInterfaces()
|
Method[] |
getMatchingMethods(java.lang.String name,
Type[] paramTypes,
int flags)
|
Method |
getMethod(java.lang.String name,
Type[] arg_types)
|
int |
getMethodCount()
|
Method |
getMethods()
Get the methods of this class. |
int |
getModifiers()
Return the modifiers (access flags) for this class. |
java.lang.String |
getNameOrSignature()
|
ClassType |
getSuperclass()
|
boolean |
isInterface()
|
boolean |
isSubclass(ClassType other)
|
static ClassType |
make(java.lang.String name)
Find a ClassType with the given name, or create a new one. |
static ClassType |
make(java.lang.String name,
ClassType superClass)
|
void |
setAttributes(Attribute attributes)
Set the (list of) Attributes of this container. |
void |
setInterfaces(ClassType[] interfaces)
|
void |
setModifiers(int flags)
Set the modifiers (access flags) for this class. |
void |
setName(java.lang.String name)
Sets the name of the class being defined in this classfile. |
void |
setSourceFile(java.lang.String name)
Set the name of the SourceFile associated with this class. |
void |
setSuper(ClassType superClass)
|
void |
setSuper(java.lang.String name)
Set the superclass of the is class. |
static byte[] |
to_utf8(java.lang.String str)
Convert a String to a Utf8 byte array. |
java.lang.String |
toString()
|
byte[] |
writeToArray()
|
void |
writeToFile()
|
void |
writeToFile(java.lang.String filename)
|
void |
writeToStream(java.io.OutputStream stream)
|
| Methods inherited from class gnu.bytecode.ObjectType |
coerceFromObject,
emitCoerceFromObject,
getReflectClass |
| Methods inherited from class gnu.bytecode.Type |
coerceToObject,
emitCoerceToObject,
emitIsInstance,
getName,
getSignature,
getSize,
getType,
isInstance,
isMoreSpecific,
isSubtype,
isValidJavaTypeName,
isVoid,
lookupType,
lowestCommonSuperType,
make,
promote,
registerTypeForClass,
setSignature,
signatureLength,
signatureLength,
signatureToName,
signatureToPrimitive,
signatureToType,
signatureToType,
swappedCompareResult |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final int minor_version
public static final int major_version
public int access_flags
public Method constructor
| Constructor Detail |
public ClassType()
public ClassType(java.lang.String class_name)
| Method Detail |
public static ClassType make(java.lang.String name)
name - the name of the class (e..g. "java.lang.String").
public static ClassType make(java.lang.String name,
ClassType superClass)
public final Attribute getAttributes()
public final void setAttributes(Attribute attributes)
public final ConstantPool getConstants()
public final CpoolEntry getConstant(int i)
public final int getModifiers()
public final void setModifiers(int flags)
public void setName(java.lang.String name)
name - the name to give to the classpublic void setSourceFile(java.lang.String name)
public void setSuper(java.lang.String name)
name - name of super class, or null if this is "Object".public void setSuper(ClassType superClass)
public ClassType getSuperclass()
public ClassType[] getInterfaces()
public java.lang.String getNameOrSignature()
public void setInterfaces(ClassType[] interfaces)
public void addInterface(ClassType newInterface)
public final boolean isInterface()
public final Field getFields()
public final int getFieldCount()
public Field getDeclaredField(java.lang.String name)
public Field getField(java.lang.String name)
public Field addField()
public Field addField(java.lang.String name)
name - the name of the new field
public final Field addField(java.lang.String name,
Type type)
public final Field addField(java.lang.String name,
Type type,
int flags)
public void addFields()
public final Method getMethods()
public final int getMethodCount()
public Method addMethod(java.lang.String name)
public Method addMethod(java.lang.String name,
int flags)
public Method addMethod(java.lang.String name,
Type[] arg_types,
Type return_type,
int flags)
public Method addMethod(java.lang.String name,
int flags,
Type[] arg_types,
Type return_type)
public Method addMethod(java.lang.String name,
java.lang.String signature,
int flags)
public Method getDeclaredMethod(java.lang.String name,
Type[] arg_types)
public Method getDeclaredMethod(java.lang.String name,
int argCount)
public Method getMethod(java.lang.String name,
Type[] arg_types)
public void addMethods(java.lang.Class clas)
clas - should be the same as getReflectClass().
public Method[] getMatchingMethods(java.lang.String name,
Type[] paramTypes,
int flags)
public void doFixups()
public void writeToStream(java.io.OutputStream stream)
throws java.io.IOException
public void writeToFile(java.lang.String filename)
throws java.io.IOException
public void writeToFile()
throws java.io.IOException
public byte[] writeToArray()
throws java.io.IOException
public static byte[] to_utf8(java.lang.String str)
str - the input String.public final boolean isSubclass(ClassType other)
public int compare(Type other)
public java.lang.String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||