Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Annotation to cause package import
Annotation to cause package import [message #1041697] Mon, 15 April 2013 12:31 Go to next message
J. Michael Dean, M.D. is currently offline J. Michael Dean, M.D.
Messages: 218
Registered: July 2009
Senior Member
In my model I have an operation with a body that uses a
GregorianCalendar (image attached). The generated code is fine except
that there is no import at the beginning of the file, so this method has
an error that I have to manually fix by importing GregorianCalendar.

How can I annotate the model for such a simple thing as making sure that
the generator generates the following in its list of imports?

import java.util.GregorianCalendar;

Thanks for any assistance.

- Mike
  • Attachment: model.tiff
    (Size: 26.20KB, Downloaded 41 times)
Re: Annotation to cause package import [message #1041734 is a reply to message #1041697] Mon, 15 April 2013 13:38 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26141
Registered: July 2009
Senior Member
Mike,

You'd have an easier time if you use Xcore... In general in the bodies
you need to use fully qualified names. You can surround such a name
with <%%> to indicate you want it imported, e.g., <%a.b.C%> will result
in an import of a.b.C and the use of C in the body, assuming there isn't
some other conflicting import of C, in which case the fully qualified
name is used in the body.


On 15/04/2013 2:31 PM, J Michael Dean wrote:
> In my model I have an operation with a body that uses a
> GregorianCalendar (image attached). The generated code is fine except
> that there is no import at the beginning of the file, so this method
> has an error that I have to manually fix by importing GregorianCalendar.
>
> How can I annotate the model for such a simple thing as making sure
> that the generator generates the following in its list of imports?
>
> import java.util.GregorianCalendar;
>
> Thanks for any assistance.
>
> - Mike
Re: Annotation to cause package import [message #1041903 is a reply to message #1041734] Mon, 15 April 2013 18:41 Go to previous message
J. Michael Dean, M.D. is currently offline J. Michael Dean, M.D.
Messages: 218
Registered: July 2009
Senior Member
On 4/15/13 7:38 AM, Ed Merks wrote:
> Mike,
>
> You'd have an easier time if you use Xcore... In general in the bodies
> you need to use fully qualified names. You can surround such a name
> with <%%> to indicate you want it imported, e.g., <%a.b.C%> will result
> in an import of a.b.C and the use of C in the body, assuming there isn't
> some other conflicting import of C, in which case the fully qualified
> name is used in the body.
>
>
> On 15/04/2013 2:31 PM, J Michael Dean wrote:
>> In my model I have an operation with a body that uses a
>> GregorianCalendar (image attached). The generated code is fine except
>> that there is no import at the beginning of the file, so this method
>> has an error that I have to manually fix by importing GregorianCalendar.
>>
>> How can I annotate the model for such a simple thing as making sure
>> that the generator generates the following in its list of imports?
>>
>> import java.util.GregorianCalendar;
>>
>> Thanks for any assistance.
>>
>> - Mike
>
That worked perfectly (and cleaned up the bodies where I had remembered
to use the fully qualified names). Thank you.

Have not heard of Xcore - barely climbing the initial EMF learning
curve. Will take a look. Thanks for the suggestion.

- Mike
Previous Topic:Annotation to cause package import
Next Topic:Validating emf model using OAW framework and Check language
Goto Forum:
  


Current Time: Sun Oct 26 06:06:19 GMT 2014

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

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