|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.intermine.codegen.JavaModelOutput
public class JavaModelOutput
Maps InterMine metadata to Java source files
| Field Summary | |
|---|---|
protected static java.lang.String |
ENDL
|
protected java.io.File |
file
|
protected static java.lang.String |
INDENT
|
protected Model |
model
|
| Constructor Summary | |
|---|---|
JavaModelOutput(Model model,
java.io.File file)
Constructor. |
|
| Method Summary | |
|---|---|
protected java.lang.String |
generate(AttributeDescriptor attr,
boolean field)
Generates code for a single attribute. |
protected java.lang.String |
generate(ClassDescriptor cld,
boolean shadow)
Generate the output for a ClassDescriptor. |
protected java.lang.String |
generate(CollectionDescriptor col,
boolean field)
Generates code for a single collection. |
protected java.lang.String |
generate(ReferenceDescriptor ref,
boolean field)
Generates code for a single reference. |
java.lang.String |
generateAddCollectionElement(ClassDescriptor cld)
Generates the addCollectionElement method. |
protected java.lang.String |
generateEquals(ClassDescriptor cld)
Generate a .equals() method for the given class. |
protected java.lang.String |
generateFieldDescriptors(ClassDescriptor cld,
boolean supers)
Generate all FieldDescriptors for a class/interface |
java.lang.String |
generateGetElementType(ClassDescriptor cld)
Generates the getElementType method. |
java.lang.String |
generateGetFieldType(ClassDescriptor cld)
Generates the getFieldType method. |
java.lang.String |
generateGetFieldValue(ClassDescriptor cld,
boolean proxy)
Generates the getFieldValue method. |
protected java.lang.String |
generateGetObject(ClassDescriptor cld)
Generates the getoBJECT method for producing NotXml. |
protected java.lang.String |
generateGetSet(FieldDescriptor field,
boolean fieldPresent)
Write code for getters and setters for given field. |
protected java.lang.String |
generateHashCode(ClassDescriptor cld)
Generate a .hashCode() method for the given class. |
java.lang.String |
generateSetFieldValue(ClassDescriptor cld)
Generates the setFieldValue method. |
java.lang.String |
generateSetObject(ClassDescriptor cld)
Generates the setoBJECT method for deserialising objects. |
protected java.lang.String |
generateToString(ClassDescriptor cld)
Generate a .toString() method for the given class . |
protected java.lang.String |
getType(FieldDescriptor field)
Return the java type of a particular field. |
void |
process()
Perform the mapping. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String INDENT
protected static final java.lang.String ENDL
protected Model model
protected java.io.File file
| Constructor Detail |
|---|
public JavaModelOutput(Model model,
java.io.File file)
throws java.lang.Exception
model - a Modelfile - a File
java.lang.Exception - if something goes wrong| Method Detail |
|---|
public void process()
protected java.lang.String generate(ClassDescriptor cld,
boolean shadow)
cld - the ClassDescriptorshadow - whether to generate the shadow class of an interface
protected java.lang.String generateFieldDescriptors(ClassDescriptor cld,
boolean supers)
cld - the ClassDescriptor of the classsupers - true if go up the inheritence tree and output fields
protected java.lang.String generate(AttributeDescriptor attr,
boolean field)
attr - the AttributeDescriptorfield - true if the class should have the associated field, or false if the field is in
the superclass
protected java.lang.String generate(ReferenceDescriptor ref,
boolean field)
ref - the ReferenceDescriptorfield - true if the class should have the associated field, or false if the field is in
the superclass
protected java.lang.String generate(CollectionDescriptor col,
boolean field)
col - the CollectionDescriptorfield - true if the class should have the associated field, or false if the field is in
the superclass
protected java.lang.String generateGetSet(FieldDescriptor field,
boolean fieldPresent)
field - descriptor for fieldfieldPresent - true if this class has the associated field
protected java.lang.String generateEquals(ClassDescriptor cld)
cld - descriptor for class in question
protected java.lang.String generateHashCode(ClassDescriptor cld)
cld - descriptor for the class in question
protected java.lang.String generateToString(ClassDescriptor cld)
cld - descriptor for the class in question
protected java.lang.String getType(FieldDescriptor field)
field - descriptor for the field in question
protected java.lang.String generateGetObject(ClassDescriptor cld)
cld - the ClassDescriptor
public java.lang.String generateSetObject(ClassDescriptor cld)
cld - a ClassDescriptor
public java.lang.String generateGetFieldValue(ClassDescriptor cld,
boolean proxy)
cld - the ClassDescriptorproxy - false to make the getFieldValue method, true to make the getFieldProxy method
public java.lang.String generateSetFieldValue(ClassDescriptor cld)
cld - the ClassDescriptor
public java.lang.String generateAddCollectionElement(ClassDescriptor cld)
cld - the ClassDescriptor
public java.lang.String generateGetFieldType(ClassDescriptor cld)
cld - the ClassDescriptor
public java.lang.String generateGetElementType(ClassDescriptor cld)
cld - the ClassDescriptor
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||