|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sptci.CodeGenerator
com.sptci.echo2.ModelGenerator
com.sptci.echo2.JDOModelGenerator
public class JDOModelGenerator
A JDO JavaBean generator. In addition to generating the source file
as implemented in ModelGenerator, generates an additional
Factory class to implement interactions with the JDO
datastore, and a default JDO metadata file.
The following shows the invocation semantics for this class:
java -classpath <path to classes>:sptecho.jar:<path to Echo2_App.jar>:<path to jdom>:<path to jaxen> \
com.sptci.echo2.JDOModelGenerator \
<fully qualified name of UI class>
Copyright 2006 Sans Pareil Technologies, Inc.
JDOMetaDataGenerator| Field Summary |
|---|
| Fields inherited from class com.sptci.echo2.ModelGenerator |
|---|
imports, source, uiFields |
| Fields inherited from class com.sptci.CodeGenerator |
|---|
fields, name, primitives |
| Constructor Summary | |
|---|---|
JDOModelGenerator(java.lang.String name)
Delegates to the super-class constructor. |
|
| Method Summary | |
|---|---|
protected void |
addInstanceCallbacks()
Add InstanceCallbacks support to the JDO JavaBean. |
void |
generate()
Over-ridden to generate the factory class source and metadata file in addition to the JavaBean source. |
protected java.lang.String |
generateDeleteMethod()
Generate the delete method that will be used to delete
a JDO JavaBean to the JDO data store. |
protected void |
generateFactory()
Generate a Factory class that handles interactions
between the JDO JavaBean objects and the JDO datastore. |
protected java.lang.String |
generateFactoryInitialisers()
Generate the initialiser methods for the factory class. |
protected java.lang.String |
generateFactoryMethods()
Generate additional factory methods for fetching the JDO JavaBean instances from the JDO data store. |
protected void |
generateMetaData()
Generate the JDO meta-data file for the JDO JavaBean. |
protected java.lang.String |
generateMethods()
Generate the methods for the JavaBean. |
protected java.lang.String |
generateSaveMethod()
Generate the save method that will be used to save
a JDO JavaBean to the JDO data store. |
static void |
main(java.lang.String[] args)
Main method. |
| Methods inherited from class com.sptci.echo2.ModelGenerator |
|---|
generateBeanMethods, generateConstructors, generateDefaultConstructor, generateDesignatedConstructor, generateFields, generatePropertyChangeFields, generatePropertyChangeMethods, generateSource, processComponent |
| Methods inherited from class com.sptci.CodeGenerator |
|---|
generateCloneMethod, generateCompareToMethod, generateEqualsMethod, generateHashCodeMethod, generateToStringMethod |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JDOModelGenerator(java.lang.String name)
throws java.lang.ClassNotFoundException
name - The fully qualified name of the class. Example:
com.sptci.demo.InputForm.
java.lang.ClassNotFoundException - If the class corresponding to the
name cannot be found in the classpath.| Method Detail |
|---|
public void generate()
throws java.lang.Exception
generate in class ModelGeneratorjava.lang.Exception - If errors are encountered while generating
the source file.addInstanceCallbacks(),
generateFactory(),
generateMetaData()
protected void addInstanceCallbacks()
throws java.lang.Exception
InstanceCallbacks support to the JDO JavaBean.
Write the modified source code back to the source file.
java.lang.Exception - If errors are encountered while writing to
the file.ModelGenerator.generate()protected java.lang.String generateMethods()
generateMethods in class ModelGeneratorModelGenerator.generateMethods()
protected void generateFactory()
throws java.io.IOException
Factory class that handles interactions
between the JDO JavaBean objects and the JDO datastore.
java.io.IOException - If errors are encountered while writing the
generated source file.generateFactoryInitialisers(),
generateSaveMethod(),
generateFactoryMethods()protected java.lang.String generateFactoryInitialisers()
protected java.lang.String generateSaveMethod()
save method that will be used to save
a JDO JavaBean to the JDO data store.
protected java.lang.String generateDeleteMethod()
delete method that will be used to delete
a JDO JavaBean to the JDO data store.
protected java.lang.String generateFactoryMethods()
protected void generateMetaData()
throws org.jdom.JDOMException,
java.io.IOException
Uses JDOM and Jaxen for parsing an existing meta-data file and for creating or updating the file.
org.jdom.JDOMException - If errors are encountered while fetching
the element.
java.io.IOException - If errors are encountered while writing to
the meta-data file.JDOMetaDataGenerator.generate()public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||