|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openjava.mop.OJClass | +--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 | |
private java.lang.String |
className
This is the name of the class. |
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. |
private java.lang.String[] |
ojcImplementInterface
This field contains the interface implemented by this class. |
private OJClass |
ojcMySuperClass
This field contains the Superclass of this OJClass. |
private java.util.Vector |
ojfMyFields
This field contains all the fields that must be inserted into the class. |
private java.util.Vector |
ojmMyMethods
This field contains all the methods that must be inserted into the output class. |
private java.io.PrintStream |
psOutputFile
File object representing output class. |
private java.lang.String[] |
strImports
This field contains all the imports of the class. |
Fields inherited from class openjava.mop.OJClass |
substance |
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 |
private java.lang.String className
private java.io.PrintStream psOutputFile
private OJClass ojcMySuperClass
private java.lang.String[] ojcImplementInterface
private java.util.Vector ojfMyFields
private java.util.Vector ojmMyMethods
public java.util.Vector constructors
public java.util.Vector fstLineConstr
private java.lang.String[] strImports
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()
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()
public void printHeader()
public OJClass getSuperClass()
public void printImports()
public void printOutputClass()
public void printField(OJField field)
field
- field to be printed.public void printAllFields()
public void printConstructor()
super()
with the given parameters.public void printMethod(OJMethod method)
method
- method to print.public void printAllMethods()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |