|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.xml.xmlc.codegen.JavaClass
Object that is used to assemble the Java source for a class. Able to generate either a stand-alone class, or an interface and an implementation of that interface
Field Summary | |
protected String[] |
fDoc
|
protected int |
fModifiers
|
protected String |
fName
|
protected String |
fPackageName
Attributes of the class |
Constructor Summary | |
JavaClass(String packageName,
String name,
int modifiers,
String[] doc)
Constructor. |
Method Summary | |
void |
addClassImport(String importSpec)
Add an class imports to the class. |
void |
addClassImports(String[] importSpecs)
Add a set of class imports. |
void |
addConstructor(JavaMethod method)
Add a constructor. |
void |
addField(JavaField field)
Add a field to the class. |
void |
addImplements(String implementsName)
Add a interface that the class will implement. |
void |
addImplements(String[] implementsName)
Add a list of interface for this class to implement. |
void |
addImport(String importSpec)
Add an import to the class and interface. |
void |
addImports(String[] importSpecs)
Add a set of imports. |
void |
addMethod(JavaMethod method)
Add a method. |
JavaCode |
getClassInitializer()
Get the class initializer. |
Iterator |
getConstructors()
Get the constructors |
String[] |
getDoc()
Get the documentation, or null if there is none. |
Iterator |
getFields()
Get the fields, sorted by field name. |
Iterator |
getMethods()
Get the methods, sorted by method name. |
int |
getModifiers()
Get the modifiers. |
String |
getName()
Get the name. |
void |
printClass(IndentWriter out)
Output a generated class which doesn't have a corresponding interface. |
void |
printImplementation(IndentWriter out)
Output a generated class which has an interface. |
void |
printInterface(IndentWriter out)
Output a generated interface. |
void |
setExtends(String extendsName)
Set the class that this class extends. |
void |
setInterface(String interfaceName)
Set the interface name for the associated generated interface. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected String fPackageName
protected String fName
protected int fModifiers
protected String[] fDoc
Constructor Detail |
public JavaClass(String packageName, String name, int modifiers, String[] doc)
packageName
- package for the class, or null for default package.name
- class namemodifiers
- class modifier bit set.doc
- Class documentation, each row becomes a line of
documentation.JavaModifiers
Method Detail |
public void setInterface(String interfaceName)
public void addClassImport(String importSpec)
importSpec
- Name package, class, or package.* to import.
Should not include import keyword. Duplicates will be discarded.public void addClassImports(String[] importSpecs)
importSpecs
- Names of packages, classes, or package.* to import.
Should not include import keyword.public void addImport(String importSpec)
importSpec
- Name package, class, or package.* to import.
Should not include import keyword. Duplicates will be discarded.public void addImports(String[] importSpecs)
importSpecs
- Names of packages, classes, or package.* to import.
Should not include import keyword. Duplicates will be discarded.public void setExtends(String extendsName)
public void addImplements(String implementsName)
public void addImplements(String[] implementsName)
public void addField(JavaField field)
public void addConstructor(JavaMethod method)
public void addMethod(JavaMethod method)
public String getName()
public int getModifiers()
public String[] getDoc()
public Iterator getFields()
public JavaCode getClassInitializer()
public Iterator getConstructors()
public Iterator getMethods()
public void printClass(IndentWriter out)
public void printInterface(IndentWriter out)
public void printImplementation(IndentWriter out)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |