samples/gen_again_java.ysl2
author Volker Birk <vb@pep-project.org>
Mon, 04 Nov 2019 11:37:27 +0100
changeset 39 054ce625f75a
parent 0 76005e62091d
permissions -rw-r--r--
Added tag 2.6.2 for changeset f93de5b34430
include yslt.yml2

tstylesheet {
    template "/xmi:XMI/uml:Model" {
        apply "Package", 0;
    }

    template 'packagedElement[xmi:type="uml:Package"]' {
        | package «@name»;
        | 
        apply "packagedElement", 0;
    }

    template 'packagedElement[xmi:type="uml:Class"]' {
        | class «@name» {
        apply 'ownedAttribute[xmi:type="uml:Property"]';
        | }
    }

    template "Attribute" {
        |     // attribute «@name»
        | 
        |     public «type» get«@name»() {
        |         return «@name»;
        |     }
        | 
        |     public void set«@name»(«type» value) {
        |         «@name» = value;
        |     }
        | 
        |     private «type» «@name»;
    }
}