|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openjava.mop.OJClass | +--mChaRM.PremChaRM.OJSubClass
This class represents the structure of a class and allow to write to disk the code it contains. In particulary it contains methods to create the classes and to get some info about them. The difference with OJClass is that the last one don't allow to write a code of a new class, but it allow to modify current class of "ojc" compilation, OJSubClass permit to create a new Java class.
Field Summary | |
java.util.Vector |
constructors
This field contains the constructors. |
java.util.Vector |
fstLineConstr
This field contains, if present, the invocation of costructor in first line of constructor. |
Fields inherited from interface openjava.mop.OJMember |
DECLARED, PUBLIC |
Constructor Summary | |
OJSubClass(java.lang.String name,
java.lang.String extendsName,
java.lang.String[] imports)
This constructor have to be used if class have no interfaces. |
|
OJSubClass(java.lang.String name,
java.lang.String extendsName,
java.lang.String[] interfaceName,
java.lang.String[] imports)
This constructor have to be used if class have some interfaces. |
Method Summary | |
void |
addNewConstructor(OJMethod constructor)
This method add Constructor to the class |
void |
addNewFields(OJField field)
This method add field to the class |
void |
addNewFields(java.util.Vector fields)
This method add fields to the class |
void |
addNewMethods(OJMethod method)
Add method to the class |
void |
addNewMethods(java.util.Vector methods)
Add methods to the class |
boolean |
DeleteFields(OJField field)
This method delete field to the class |
boolean |
DeleteFields(java.util.Vector fields)
This method delete fields to the class |
boolean |
DeleteMethods(OJMethod method)
Delete method to the class |
boolean |
DeleteMethods(java.util.Vector methods)
Delete methods to the class |
protected void |
finalize()
|
java.lang.String[] |
getInterfacesStr()
This method return name of inmpleted interface. |
java.lang.String |
getName()
This method return name of this class. |
OJClass |
getSuperClass()
This method return the superclass of this class. |
void |
printAllFields()
This method print all fields calling printField method for each field. |
void |
printAllMethods()
This method print all methods to the output file calling printMethod method for each OJMethod. |
void |
printConstructor()
This method print the constructor of the class to the output file (with the exception it throws). |
void |
printField(OJField field)
This method print the specified field (whith its modifiers and type) to the output file. |
void |
printHeader()
This method print the initial part of the class. |
void |
printImports()
This method print all imports int the output file. |
void |
printMethod(OJMethod method)
This method print the specified method to the output file. |
void |
printOutputClass()
This method print the whole class. |
void |
setImports(java.lang.String[] newImports)
This method set the imports of this class. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public java.util.Vector constructors
addNewConstructor
method.public java.util.Vector fstLineConstr
Constructor Detail |
public OJSubClass(java.lang.String name, java.lang.String extendsName, java.lang.String[] imports) throws java.lang.ClassNotFoundException
name
- name of the classextendsname
- name of class to extend.public OJSubClass(java.lang.String name, java.lang.String extendsName, java.lang.String[] interfaceName, java.lang.String[] imports) throws java.lang.ClassNotFoundException
name
- name of the class.extendsname
- name of class to extend.interfaceName
- name of interface that are implemented by this class.Method Detail |
public java.lang.String[] getInterfacesStr()
public java.lang.String getName()
getName
in class OJClass
public void setImports(java.lang.String[] newImports)
newImports
- array of imports to setpublic void addNewFields(java.util.Vector fields)
fields
- vector of fields to addpublic void addNewFields(OJField field)
field
- field to addpublic boolean DeleteFields(OJField field)
field
- field to deletepublic boolean DeleteFields(java.util.Vector fields)
fields
- vector of field to deletepublic void addNewMethods(java.util.Vector methods)
methods
- vector of methods to addpublic void addNewMethods(OJMethod method)
method
- method to addpublic boolean DeleteMethods(OJMethod method)
method
- method to deletepublic boolean DeleteMethods(java.util.Vector methods)
methods
- vector of methods to deletepublic void addNewConstructor(OJMethod constructor)
plParams
- constructor parametersstrException
- constructor exceptionprotected void finalize()
finalize
in class java.lang.Object
public void printHeader()
PrintImports
, then
prints the declaration of the class and finally it prints extends clause and implements clausepublic OJClass getSuperClass()
public void printImports()
public void printOutputClass()
PrintHeader
,
printAllFields
and
printAllMethods
public void printField(OJField field)
field
- field to be printed.public void printAllFields()
printField
method for each field.public void printConstructor()
super()
with the given parameters.public void printMethod(OJMethod method)
method
- method to print.public void printAllMethods()
printMethod
method for each OJMethod.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |