|
|
|
Re: [Xpand / Xtend] typeSelect() on stereotype does not work [message #641851 is a reply to message #641849] |
Sun, 28 November 2010 18:37 |
|
Hi,
i use a workflow that looks like this
<workflow>
<bean class="org.eclipse.xtend.typesystem.uml2.Setup" standardUML2Setup="true" />
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri=".." />
<component class="org.eclipse.emf.mwe.utils.Reader">
<uri value="platform:/resource/xpand.uml.profile.sample/src/model/test.uml" />
<modelSlot value="model" />
</component>
<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner">
<directory value="src-gen" />
</component>
<component class="org.eclipse.xpand2.Generator">
<metaModel class="org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel">
<profile value="platform:/resource/xpand.uml.profile.sample/src/model/test.profile.uml" />
</metaModel>
<metaModel class="org.eclipse.xtend.typesystem.uml2.UML2MetaModel" />
<expand value="template::Template::main FOR model" />
<outlet path="src-gen" >
<postprocessor class="org.eclipse.xpand2.output.JavaBeautifier" />
</outlet>
</component>
</workflow>
this works together with a template like
«EXTENSION template::GeneratorExtensions»
«DEFINE main FOR uml::Model»
«EXPAND main FOREACH this.eAllContents.typeSelect(test::Bean)»
«ENDDEFINE»
«DEFINE main FOR test::Bean»
«FILE getFQPN().replaceAll("\\.","/")+"/"+name+".java"»
package «getFQPN()»;
public class «name» {
}
«ENDFILE»
«ENDDEFINE»
«DEFINE main FOR uml::Element»
«ENDDEFINE»
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
[Updated on: Sun, 28 November 2010 18:41] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.04354 seconds