Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/larusso/modeler
Generate sourcecode from xml model definitions
https://github.com/larusso/modeler
Last synced: 17 days ago
JSON representation
Generate sourcecode from xml model definitions
- Host: GitHub
- URL: https://github.com/larusso/modeler
- Owner: Larusso
- Created: 2013-01-02T18:52:29.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-02-06T15:38:13.000Z (almost 8 years ago)
- Last Synced: 2024-10-11T10:47:07.371Z (about 1 month ago)
- Language: Clojure
- Size: 182 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Modeler
======
*generate model source code from xml definitions*
***Modeler is a Programm to generate class model source code from xml model definitions.
Any language with a basic class system is supported. Your can generate multiple languages with the same model definition.There are different template projects available:
//todo add list of template projects
## Usage
### run from source with [leiningen 2][lein]
Make sure you have installed [leiningen][lein_install] on your system.
Run Modeler like this:lein run -- [options] path/to/model-definition.xml
### run from modeler.jar
You can eather build or download the modeler.jar.
A complete jar with all dependencies can be found [here][modelerJar]:java -jar path/to/modle.jar -- [options] path/to/model-definition.xml
### Options
use the option -h or --help when you run Modeler to see a help page with all available options
usage: Modeler [options] [model PATH]
Switches Default Desc
-------- ------- ----
-lang, --languages ["*"] comma separated list of languages to generate example 'as3,java,objc'
-t, --template-path ./templates/ Path to template files
-o, --output-path ./generated/ The output path
-v, --no-verbose, --verbose false
-h, --no-help, --help false Show help### Model XML
You define your class definitions with a simple xml structure. You can define classes and interfaces. You can set a lang attributes to all entities to generate only language specific classes, interfaces, methods, properties, … and so on.
**example:**
```xml
```
For a full modeler xml description see: //todo add link to wiki here### Generated Model
Modeler transforms the xml definitions to clojure data. Modeler applies the designated template to all entries after the conversion. The [mustache][mustache] template will be provided with a hashmap containing all the converted information
-- add example here
For a full description see: //todo add link to wiki here
### Class Templates
Templates are written in the logic less [mustache][mustache] style.
Each template is referenced by its template key and language.**example:**
* __java class template__ java.class.mustache
* __java iface template__ java.iface.mustacheclass and face are the default template keys for class and iface model definitions. You can set any template key for your class or iface definition.
**example:**
* __as3 decorator class template__ as3.decoratorClass.mustache## run 'Modeler'
### run with lein2
Make sure you have installed [leiningen][lein] on your system.
Run Modeler like this:lein run -- path/to/model.xml
### create uberjar
Create a uberjar with leiningen:
lein uberjar
## License
Copyright (C) 2012 Manfred Endres
Distributed under the Eclipse Public License, the same as Clojure.
[lein]: https://github.com/technomancy/leiningen "leiningen 2"
[lein_install]: https://github.com/technomancy/leiningen/wiki/Upgrading "leiningen installation"
[mustache_man]: http://mustache.github.com/mustache.5.html "mustache manual"
[mustache]: http://mustache.github.com "mustache -- Logic-less templates."
[modelerJar]: http://www.google.de