|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface JClassFile
The JClassFile interface represents the ClassFile structure described in chapter 4 of the JVM Specification.
| Method Summary | |
|---|---|
void |
addAttribute(JAttribute attribute)
Adds an attributes of this class file. |
void |
addConstructor(JClassMember constructor)
Adds and returns a new constructor to the class defined by this class file. |
JClassMember |
addConstructor(java.lang.String descriptor,
int accessFlags,
JAttribute[] attributes)
Adds and returns a new constructor to the class defined by this class file. |
JClassMember |
addDefaultConstructor(int accessFlags)
Adds and returns a default constructor to the class defined by this class file. |
void |
addField(JClassMember field)
Adds and returns a new field to the class defined by this class file. |
JClassMember |
addField(java.lang.String name,
java.lang.String descriptor,
int accessFlags,
JAttribute[] attributes)
Adds and returns a new field to the class defined by this class file. |
void |
addInterface(java.lang.String name)
Adds the specified super interface to the class defined by this class file. |
void |
addMethod(JClassMember method)
Adds and returns a new method to the class defined by this class file. |
JClassMember |
addMethod(java.lang.String name,
java.lang.String descriptor,
int accessFlags,
JAttribute[] attributes)
Adds and returns a new method to the class defined by this class file. |
int |
getAccessFlags()
Returns the mask of flags used to denote access permissions to and properties of the class or interface represented by this JClassFile object. |
JAttribute[] |
getAttributes()
Returns an array of attributes of this class file. |
JClassMember |
getDeclaredConstructor(java.lang.String desc)
Returns the constructor with the specified descriptor. |
JClassMember[] |
getDeclaredConstructors()
Returns an array of JClassMember object, corresponding to the constructors declared by the class defined by this class file. |
JClassMember |
getDeclaredField(java.lang.String name)
Returns the field with the specified name. |
JClassMember[] |
getDeclaredFields()
Returns an array of JClassMember object, corresponding to the fields declared by the class defined by this class file. |
JClassMember |
getDeclaredMethod(java.lang.String name,
java.lang.String desc)
Returns the method with the specified name and descriptor. |
JClassMember[] |
getDeclaredMethods()
Returns an array of JClassMember object, corresponding to the methods declared by the class defined by this class file. |
int[] |
getInterfaceIndex()
Returns an array containing index of constant pool entry describing a super interface of the class defined by this class file. |
java.lang.String[] |
getInterfaceNames()
Returns an array of String object, corresponding to the name of super interface of the class defined by this class file. |
int |
getMajorVersion()
Returns the major version of the classfile. |
int |
getMinorVersion()
Returns the minor version of the classfile. |
java.lang.String |
getName()
Returns the name of the class represented by this class file. |
int |
getSuperclassIndex()
Returns the index into a CONSTANT_Class_info constant pool entry representing the superclass of the class defined by this class file. |
java.lang.String |
getSuperclassName()
Returns the name of the superclass of the class represented by this class file. |
int |
getThisClassIndex()
Returns the index of the CONSTANT_Class_info constant pool entry representing the class or interface defined by this class file. |
void |
removeDefaultConstructor()
Removes the default constructor of the class defined by this class file. |
void |
setAccessFlags(int accessFlags)
Sets the mask of flags used to denote access permissions to and properties of the class or interface represented by this JClassFile object. |
void |
setDeclaredConstructors(JClassMember[] constructors)
Sets the constructors of the class defined by this class file. |
void |
setDeclaredFields(JClassMember[] fields)
Sets the declared fields of the class defined by this class file. |
void |
setDeclaredMethods(JClassMember[] methods)
Sets the methods of the class defined by this class file. |
void |
setInterfaceIndex(int[] interfaceIndex)
Sets the array containing index of constant pool entry describing a super interface of the class defined by this class file. |
void |
setMajorVersion(int majorVersion)
Sets the major version of the classfile. |
void |
setMinorVersion(int minorVersion)
Sets the minor version of the classfile. |
void |
setName(java.lang.String name)
Sets the name of the class represented by this class file. |
void |
setSuperclassIndex(int superclassIndex)
Sets the index into a CONSTANT_Class_info constant pool entry representing the superclass of the class defined by this class file. |
void |
setSuperclassName(java.lang.String name)
Sets the name of the superclass of the class represented by this class file. |
void |
setThisClassIndex(int thisClassIndex)
Sets the index into a CONSTANT_Class_info constant pool entry representing the class or interface defined by this class file. |
java.lang.String |
toString()
Returns a string representation of this classfile. |
| Methods inherited from interface fr.umlv.corosol.classfile.JClassFileItem |
|---|
getConstantPool, readItem, setConstantPool, writeItem |
| Method Detail |
|---|
int getMinorVersion()
void setMinorVersion(int minorVersion)
minorVersion - the minor version of the classfile.int getMajorVersion()
void setMajorVersion(int majorVersion)
majorVersion - the major version of the classfile.int getAccessFlags()
void setAccessFlags(int accessFlags)
accessFlags - the access flags of the classint getThisClassIndex()
void setThisClassIndex(int thisClassIndex)
thisClassIndex - the index of a constant pool entry representing
the classint getSuperclassIndex()
void setSuperclassIndex(int superclassIndex)
superclassIndex - the index of a constant pool entry representing
the superclass of the classint[] getInterfaceIndex()
void setInterfaceIndex(int[] interfaceIndex)
interfaceIndex - an array of index describing the super interfacesjava.lang.String getName()
void setName(java.lang.String name)
name - the name of the classjava.lang.String getSuperclassName()
void setSuperclassName(java.lang.String name)
name - the name of the superclassjava.lang.String[] getInterfaceNames()
void addInterface(java.lang.String name)
name - the name of the super interfaceJClassMember[] getDeclaredFields()
JClassMember[] getDeclaredMethods()
JClassMember[] getDeclaredConstructors()
JClassMember getDeclaredField(java.lang.String name)
name - the field name
JClassMember getDeclaredMethod(java.lang.String name,
java.lang.String desc)
name - the method namedesc - the method descriptor
JClassMember getDeclaredConstructor(java.lang.String desc)
desc - the constructor descriptor
void setDeclaredFields(JClassMember[] fields)
fields - an array of new fieldsvoid setDeclaredMethods(JClassMember[] methods)
methods - an array of new methodsvoid setDeclaredConstructors(JClassMember[] constructors)
constructors - an array of new constructors
JClassMember addField(java.lang.String name,
java.lang.String descriptor,
int accessFlags,
JAttribute[] attributes)
name - the field namedescriptor - the field descriptoraccessFlags - the access flag of the fieldattributes - the field attributes
void addField(JClassMember field)
field - a new field
JClassMember addMethod(java.lang.String name,
java.lang.String descriptor,
int accessFlags,
JAttribute[] attributes)
name - the method namedescriptor - the method descriptoraccessFlags - the access flag of the methodattributes - the method attributes
void addMethod(JClassMember method)
method - a new method
JClassMember addConstructor(java.lang.String descriptor,
int accessFlags,
JAttribute[] attributes)
descriptor - the constructor descriptoraccessFlags - the access flag of the constructorattributes - the constructor attributes
void addConstructor(JClassMember constructor)
constructor - a new constructorJClassMember addDefaultConstructor(int accessFlags)
accessFlags - the access flag of the default constructor
void removeDefaultConstructor()
JAttribute[] getAttributes()
void addAttribute(JAttribute attribute)
attribute - an attributejava.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||