Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo 3] hasStereotype(acceleo 2 --> acceleo3)
[Acceleo 3] hasStereotype [message #554345] Sat, 21 August 2010 20:44 Go to next message
Eclipse UserFriend
Hi,

I want to create a new module with acceleo3. And well, I did something with acceleo2, I know that with acceleo2 I can control the creation of files with something like:

<%script type="Class" name="fullFilePath"%>
<%if ( isService ){%><%pathToMainJava%>/<%serviceImplPackage.toPath()%>/<%name% >Impl.java<%}%>

<%script type="Classifier" name="isService"%>
<%hasStereotype(getProperty("Service"))%>

where hasStereotype is a java service...

How can I do something like this with acceleo3?
And, is there any module in acceleo 3 (not a simple module!)?

thank you very much!
s2o

[Updated on: Sat, 21 August 2010 20:47] by Moderator

Re: [Acceleo 3] hasStereotype [message #554384 is a reply to message #554345] Sun, 22 August 2010 14:22 Go to previous messageGo to next message
Eclipse UserFriend
Hello s2o

I have writen the following query to check if an Element has an applied Stereotype

[query public hasStereotype(e : Element, stereo : String) : Boolean = (self.getAppliedStereotype(stereo) <> null)/]

the parameter stereo is the the qualifiedName of the Stereotype
hope this helps



Re: [Acceleo 3] hasStereotype [message #554395 is a reply to message #554384] Sun, 22 August 2010 15:43 Go to previous messageGo to next message
Eclipse UserFriend
yes!!
at the same time I got the answer Smile
Another trick is that the string stereotype must have all the path:
ie, with Acceleo.Business.profile.uml for Service stereotype
the parameter of getAppliedStereotype must be:
'Acceleo::Business::Service'

anyway, thank you very much!!!
Re: [Acceleo 3] hasStereotype [message #554396 is a reply to message #554395] Sun, 22 August 2010 15:45 Go to previous message
Eclipse UserFriend
oh yeah! the qualifiedName Wink
Previous Topic:[JET] Output not placed under src
Next Topic:[Xpand] Running Xpand from Java can't find Xtend generator extension file
Goto Forum:
  


Current Time: Fri Jul 04 12:05:49 EDT 2025

Powered by FUDForum. Page generated in 0.11292 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top