Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [comment encoding = UTF-8 /]
- [**
- * The documentation of the module generate.
- */]
- [module generate('http://www.eclipse.org/uml2/5.0.0/UML')]
- [**
- * The documentation of the template generateElement.
- * @param aClass
- */]
- [comment encoding = UTF-8 /]
- [**
- * The documentation of the module generate.
- */]
- [query public hastereotype(e:Element, s:String):Boolean=not self.getAppliedStereotype(s).oclIsUndefined()/]
- [**
- * The documentation of the template generateElement.
- * @param aClass
- */]
- [template public generateElement(aClass : Class)]
- [comment @main/]
- [if(hastereotype('EntityProfile::JEntity'))]
- [file (aClass.name + '.java', false, 'UTF-8')]
- public class [name/]{
- [generarDeAtributos(aClass)/]
- public void [aClass.name/](){}
- [generarGetSetAtributos(aClass)/]
- }
- [/file]
- [/if]
- [/template]
- [template public generarDeAtributos(aClass : Class)]
- [for(atributo: Property | aClass.attribute) separator('\n')]
- private [atributo.type.name/] [atributo.name/];
- [/for]
- [/template]
- [template public generarGetSetAtributos(aClass : Class)]
- [for(atributo: Property | aClass.attribute) separator('\n')]
- public [atributo.type.name/] [atributo.name.toUpperFirst()/](){
- return this.[atributo.name/];
- }
- [/for]
- [for(atributo: Property | aClass.attribute) separator('\n')]
- public void set [atributo.name.toUpperFirst()/]([atributo.type.name/] [atributo.name/] ){
- this.[atributo.name/] = [atributo.name/];
- }
- [/for]
- [/template]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement