public class ClassDefinition extends CodeDefinition
Purpose: Model a class for code generation purposes.
Modifier and Type | Field and Description |
---|---|
static int |
CLASS_TYPE |
static int |
INTERFACE_TYPE |
Constructor and Description |
---|
ClassDefinition() |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(AttributeDefinition attribute) |
void |
addImport(java.lang.String importStatement)
The importStatement should be of the form
"{packageName}.{shortName or '*'}"
|
void |
addInnerClass(ClassDefinition classDefinition) |
void |
addInterface(java.lang.String interfaceClassName) |
void |
addMethod(MethodDefinition method) |
void |
calculateImports()
Parses the class definition, pulls out fully qualified class names,
adds imports for them, and un-fully qualifies the class names.
|
boolean |
containsMethod(MethodDefinition method) |
java.lang.String |
getPackageName() |
java.lang.String |
getSuperClass() |
int |
getType() |
boolean |
isInterface() |
void |
setPackageName(java.lang.String packageName) |
void |
setSuperClass(java.lang.String superClass)
If the class to be generated is an interface, do not use this method.
|
void |
setType(int type) |
void |
write(CodeGenerator generator)
Write the code out to the generator's stream.
|
void |
writeBody(CodeGenerator generator)
Write the code out to the generator's stream.
|
getAccessLevel, getComment, getName, setAccessLevel, setComment, setName, toString
public static final int CLASS_TYPE
public static final int INTERFACE_TYPE
public void addAttribute(AttributeDefinition attribute)
public void addImport(java.lang.String importStatement)
public void addInnerClass(ClassDefinition classDefinition)
public void addInterface(java.lang.String interfaceClassName)
public void addMethod(MethodDefinition method)
public void calculateImports()
public boolean containsMethod(MethodDefinition method)
public java.lang.String getPackageName()
public java.lang.String getSuperClass()
public int getType()
public boolean isInterface()
public void setPackageName(java.lang.String packageName)
public void setSuperClass(java.lang.String superClass)
public void setType(int type)
public void write(CodeGenerator generator)
write
in class CodeDefinition
public void writeBody(CodeGenerator generator)
writeBody
in class CodeDefinition
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference