Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Texo/QuickStart"

(New page: __TOC__ TO BE DONE)
 
Line 1: Line 1:
 
__TOC__
 
__TOC__
  
TO BE DONE
+
== Quick Start ==
 +
The quick start let you generate code in a few minutes:
 +
* Download & install Texo through the update manager
 +
* Create a java project (plugin or normal)
 +
* Take an ecore or xsd file, or use this file here, place this file somewhere in the java project
 +
* Add the following dependencies to the java project:
 +
* Right click on the ecore or xsd file and do Texo > Generate Code. This will create a new folder (src-gen) in the project with the generated code.
 +
* Add this new folder as source folder to the project. You will probably get compile errors as not all dependencies are set. To get rid of these add the following plugins to the dependency:
 +
** org.eclipse.emf.ecore
 +
** org.eclipse.emf.texo
 +
If you have a normal java project then you need to set these dependencies as jar files. The org.eclipse.emf.ecore.jar and org.eclipse.emf.texo.jar files can be found in the eclipse installation in the plugins folder.
 +
 
 +
== Next Steps ==
 +
As a next step you can try the following:
 +
* make it more complex by using more complex models or generate for multiple models at the same time.
 +
* try overriding templates
 +
* change the implementation of some methods (change the javadoc tag @generated to @generatedNOT) and see that when you re-generate that the manual changes remain.
 +
* do XML/XMI serialization. Note that for XML/XMI serialization you sometimes have to implement the String conversion methods in the generated ModelFactory class (see the UnsupportedOperationExceptions which are possibly generated there now).

Revision as of 12:18, 7 March 2010

Quick Start

The quick start let you generate code in a few minutes:

  • Download & install Texo through the update manager
  • Create a java project (plugin or normal)
  • Take an ecore or xsd file, or use this file here, place this file somewhere in the java project
  • Add the following dependencies to the java project:
  • Right click on the ecore or xsd file and do Texo > Generate Code. This will create a new folder (src-gen) in the project with the generated code.
  • Add this new folder as source folder to the project. You will probably get compile errors as not all dependencies are set. To get rid of these add the following plugins to the dependency:
    • org.eclipse.emf.ecore
    • org.eclipse.emf.texo

If you have a normal java project then you need to set these dependencies as jar files. The org.eclipse.emf.ecore.jar and org.eclipse.emf.texo.jar files can be found in the eclipse installation in the plugins folder.

Next Steps

As a next step you can try the following:

  • make it more complex by using more complex models or generate for multiple models at the same time.
  • try overriding templates
  • change the implementation of some methods (change the javadoc tag @generated to @generatedNOT) and see that when you re-generate that the manual changes remain.
  • do XML/XMI serialization. Note that for XML/XMI serialization you sometimes have to implement the String conversion methods in the generated ModelFactory class (see the UnsupportedOperationExceptions which are possibly generated there now).

Back to the top