|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sptci.CodeGenerator
com.sptci.echo2.binding.ModelGenerator
com.sptci.echo2.binding.JDOModelDecoratorGenerator
public class JDOModelDecoratorGenerator
A JDO JavaBean decorator generator. Uses reflection to create a decorator that maps the UI component fields in the specified class with their equivalent in the JDO JavaBean for the component.
The following shows the invocation semantics for this class:
java -classpath <path to classes>:sptecho.jar:<path to Echo2_App.jar> \
com.sptci.echo2.JDOModelDecoratorGenerator \
<fully qualified name of UI class>
Copyright 2006 Sans Pareil Technologies, Inc.
| Field Summary |
|---|
| Fields inherited from class com.sptci.echo2.binding.ModelGenerator |
|---|
imports, source, uiFields |
| Fields inherited from class com.sptci.CodeGenerator |
|---|
fields, name, primitives |
| Constructor Summary | |
|---|---|
JDOModelDecoratorGenerator(String name)
Instantiates a new instance of ModelGenerator.source from the specified
name. |
|
| Method Summary | |
|---|---|
void |
generate()
Load the class specified, and generate a JavaBean representing its UI components. |
protected String |
generateBeanMethods()
Over-ridden to fire PropertyChangeEvents for
mutator methods. |
protected String |
generateConstructors()
Generate the constructors for the JavaBean. |
protected String |
generateDefaultConstructor()
Generate the default constructor for the JavaBean |
protected String |
generateDesignatedConstructor()
Generate the designated constructor for the JavaBean |
protected String |
generateFields()
Generate the fields for the JavaBean. |
protected String |
generateMethods()
Generate the methods for the JavaBean. |
protected String |
generatePropertyChangeFields()
Generate the fields necessary to support PropertyChangeListener ability for the bean. |
protected String |
generatePropertyChangeMethods()
Generate the methods to support property change events. |
protected void |
generateSource()
Generate the source code for the JavaBean. |
static void |
main(String[] args)
|
protected void |
processComponent(Field field)
Generate a Field for the JavaBean class that will be
generated from the specified Echo2 UI component |
| 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 JDOModelDecoratorGenerator(String name)
throws ClassNotFoundException
ModelGenerator.source from the specified
name. Initialises code geneartor containers.
name - The fully qualified name of the class. Example:
com.sptci.demo.InputForm.
ClassNotFoundException - If the class corresponding to the
name cannot be found in the classpath.| Method Detail |
|---|
public void generate()
throws Exception
generate in class ModelGeneratorException - If errors are encountered while writing to
the source file.processComponent(java.lang.reflect.Field),
generateSource()protected void processComponent(Field field)
Field for the JavaBean class that will be
generated from the specified Echo2 UI component
processComponent in class ModelGeneratorfield - The Field that represents the
Echo2 component.
protected void generateSource()
throws IOException
generateSource in class ModelGeneratorIOException - If errors are encountered while writing the
generated source file.protected String generateFields()
generateFields in class ModelGeneratorgeneratePropertyChangeFields()protected String generatePropertyChangeFields()
generatePropertyChangeFields in class ModelGeneratorprotected String generateConstructors()
generateConstructors in class ModelGeneratorgenerateDefaultConstructor(),
generateDesignatedConstructor()protected String generateDefaultConstructor()
generateDefaultConstructor in class ModelGeneratorprotected String generateDesignatedConstructor()
generateDesignatedConstructor in class ModelGeneratorprotected String generateMethods()
generateMethods in class ModelGeneratorCodeGenerator.generateToStringMethod(),
CodeGenerator.generateEqualsMethod(),
CodeGenerator.generateHashCodeMethod(),
CodeGenerator.generateCompareToMethod(),
CodeGenerator.generateCloneMethod(),
generatePropertyChangeMethods(),
generateBeanMethods()protected String generatePropertyChangeMethods()
generatePropertyChangeMethods in class ModelGeneratorprotected String generateBeanMethods()
PropertyChangeEvents for
mutator methods.
generateBeanMethods in class ModelGeneratorCodeGenerator.fields.public static void main(String[] args)
|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||