Advertisement
Guest User

Untitled

a guest
Nov 24th, 2015
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. [comment encoding = UTF-8 /]
  2. [**
  3. * The documentation of the module generate.
  4. */]
  5. [module generate('http://www.eclipse.org/uml2/5.0.0/UML')]
  6.  
  7.  
  8. [**
  9. * The documentation of the template generateElement.
  10. * @param aClass
  11. */]
  12.  
  13. [comment encoding = UTF-8 /]
  14. [**
  15. * The documentation of the module generate.
  16. */]
  17. [query public hastereotype(e:Element, s:String):Boolean=not self.getAppliedStereotype(s).oclIsUndefined()/]
  18. [**
  19. * The documentation of the template generateElement.
  20. * @param aClass
  21. */]
  22.  
  23.  
  24. [template public generateElement(aClass : Class)]
  25. [comment @main/]
  26. [if(hastereotype('EntityProfile::JEntity'))]
  27. [file (aClass.name + '.java', false, 'UTF-8')]
  28. public class [name/]{
  29. [generarDeAtributos(aClass)/]
  30. public void [aClass.name/](){}
  31. [generarGetSetAtributos(aClass)/]
  32. }
  33. [/file]
  34. [/if]
  35. [/template]
  36.  
  37. [template public generarDeAtributos(aClass : Class)]
  38.  
  39. [for(atributo: Property | aClass.attribute) separator('\n')]
  40. private [atributo.type.name/] [atributo.name/];
  41. [/for]
  42.  
  43. [/template]
  44.  
  45.  
  46. [template public generarGetSetAtributos(aClass : Class)]
  47. [for(atributo: Property | aClass.attribute) separator('\n')]
  48. public [atributo.type.name/] [atributo.name.toUpperFirst()/](){
  49. return this.[atributo.name/];
  50. }
  51. [/for]
  52.  
  53. [for(atributo: Property | aClass.attribute) separator('\n')]
  54. public void set [atributo.name.toUpperFirst()/]([atributo.type.name/] [atributo.name/] ){
  55. this.[atributo.name/] = [atributo.name/];
  56. }
  57. [/for]
  58. [/template]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement