|
|
Re: How can I use ATL to modify a java model based on a third party lib [message #791784 is a reply to message #789933] |
Mon, 06 February 2012 09:00 |
Jing Ge Messages: 12 Registered: January 2012 |
Junior Member |
|
|
Hello Hugo,
thanks for your help and kindly reply .
As I said, I knew how to create new Annotations in a java model by using MoDisco API. I want to know if it is also possible to do it ONLY using ATL. Your example of creating missing getter method shows us that we can, for example,
create method declaration based on the given source java model:
omd : Java!MethodDeclaration (
abstractTypeDeclaration <- ifd.abstractTypeDeclaration,
originalCompilationUnit <- ifd.originalCompilationUnit,
name <- let fieldName : String = ifd.fragments->first().name
in
'get' + fieldName.substring(1,1).toUpper() + fieldName.substring(2,fieldName.size()),
modifier <- om,
body <- ob,
returnType <- ota
)
create a modifier:
om : Java!Modifier (
visibility <- #public
),
Do you mean that we can create any model element like declarations/annotations/imports(even if they are unknown for the source java model) in the target java model ONLY using ATL?
best regards
Jing
[Updated on: Mon, 06 February 2012 10:01] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01806 seconds