|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfr.umlv.corosol.classfile.impl.DefaultJClassFile
public class DefaultJClassFile
The default implementation of the fr.umlv.corosol.classfile.JClassFile interface.
| Constructor Summary | |
|---|---|
DefaultJClassFile()
The default constructor. |
|
| 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. |
JConstantPool |
getConstantPool()
Returns the constant pool of the class represented by this JClassFile object. |
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 |
readItem(JClassFileInput in)
Extracts the data of this classfile item via the specified input stream. |
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 |
setConstantPool(JConstantPool constantPool)
Sets the constant pool of the class 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. |
void |
writeItem(JClassFileOutput out)
Writes the data of this classfile into a file via the specified output stream. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultJClassFile()
| Method Detail |
|---|
public int getMinorVersion()
getMinorVersion in interface JClassFilepublic void setMinorVersion(int minorVersion)
setMinorVersion in interface JClassFileminorVersion - the minor version of the classfile.public int getMajorVersion()
getMajorVersion in interface JClassFilepublic void setMajorVersion(int majorVersion)
setMajorVersion in interface JClassFilemajorVersion - the major version of the classfile.public JConstantPool getConstantPool()
getConstantPool in interface JClassFileItempublic void setConstantPool(JConstantPool constantPool)
setConstantPool in interface JClassFileItemconstantPool - the constant poolpublic int getAccessFlags()
getAccessFlags in interface JClassFilepublic void setAccessFlags(int accessFlags)
setAccessFlags in interface JClassFileaccessFlags - the access flags of the classpublic int getThisClassIndex()
getThisClassIndex in interface JClassFilepublic void setThisClassIndex(int thisClassIndex)
setThisClassIndex in interface JClassFilethisClassIndex - the index of a constant pool entry representing
the classpublic int getSuperclassIndex()
getSuperclassIndex in interface JClassFilepublic void setSuperclassIndex(int superclassIndex)
setSuperclassIndex in interface JClassFilesuperclassIndex - the index of a constant pool entry representing
the superclass of the classpublic int[] getInterfaceIndex()
getInterfaceIndex in interface JClassFilepublic void setInterfaceIndex(int[] interfaceIndex)
setInterfaceIndex in interface JClassFileinterfaceIndex - an array of index describing the super interfacespublic java.lang.String getName()
getName in interface JClassFilepublic void setName(java.lang.String name)
setName in interface JClassFilename - the name of the classpublic java.lang.String getSuperclassName()
getSuperclassName in interface JClassFilepublic void setSuperclassName(java.lang.String name)
setSuperclassName in interface JClassFilename - the name of the superclasspublic java.lang.String[] getInterfaceNames()
getInterfaceNames in interface JClassFilepublic void addInterface(java.lang.String name)
addInterface in interface JClassFilename - the name of the super interfacepublic JClassMember[] getDeclaredFields()
getDeclaredFields in interface JClassFilepublic JClassMember[] getDeclaredMethods()
getDeclaredMethods in interface JClassFilepublic JClassMember[] getDeclaredConstructors()
getDeclaredConstructors in interface JClassFilepublic void setDeclaredFields(JClassMember[] fields)
setDeclaredFields in interface JClassFilefields - an array of new fieldspublic void setDeclaredMethods(JClassMember[] methods)
setDeclaredMethods in interface JClassFilemethods - an array of new methodspublic void setDeclaredConstructors(JClassMember[] constructors)
setDeclaredConstructors in interface JClassFileconstructors - an array of new constructorspublic JClassMember getDeclaredField(java.lang.String name)
getDeclaredField in interface JClassFilename - the field name
public JClassMember getDeclaredMethod(java.lang.String name,
java.lang.String desc)
getDeclaredMethod in interface JClassFilename - the method namedesc - the method descriptor
public JClassMember getDeclaredConstructor(java.lang.String desc)
getDeclaredConstructor in interface JClassFiledesc - the constructor descriptor
public void removeDefaultConstructor()
removeDefaultConstructor in interface JClassFile
public JClassMember addField(java.lang.String name,
java.lang.String descriptor,
int accessFlags,
JAttribute[] attributes)
addField in interface JClassFilename - the field namedescriptor - the field descriptoraccessFlags - the access flag of the fieldattributes - the field attributes
public void addField(JClassMember field)
addField in interface JClassFilefield - a new field
public JClassMember addMethod(java.lang.String name,
java.lang.String descriptor,
int accessFlags,
JAttribute[] attributes)
addMethod in interface JClassFilename - the method namedescriptor - the method descriptoraccessFlags - the access flag of the methodattributes - the method attributes
public void addMethod(JClassMember method)
addMethod in interface JClassFilemethod - a new method
public JClassMember addConstructor(java.lang.String descriptor,
int accessFlags,
JAttribute[] attributes)
addConstructor in interface JClassFiledescriptor - the constructor descriptoraccessFlags - the access flag of the constructorattributes - the constructor attributes
public void addConstructor(JClassMember constructor)
addConstructor in interface JClassFileconstructor - a new constructorpublic JClassMember addDefaultConstructor(int accessFlags)
addDefaultConstructor in interface JClassFileaccessFlags - the access flag of the default constructor
public JAttribute[] getAttributes()
getAttributes in interface JClassFilepublic void addAttribute(JAttribute attribute)
addAttribute in interface JClassFileattribute - an attribute
public void readItem(JClassFileInput in)
throws java.io.IOException
readItem in interface JClassFileItemin - a class file input stream
java.lang.ClassFormatError - if an I/O error occurs when
readind the datas of thi classfile
java.io.IOException - if an I/O error occurs when
reading this classfile item datas
public void writeItem(JClassFileOutput out)
throws java.io.IOException
writeItem in interface JClassFileItemout - a class file output stream
java.io.IOException - if an I/O error occurs when
writing into the classfilepublic java.lang.String toString()
toString in interface JClassFiletoString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||