Skip to main content



      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 08:31 Go to next message
Eclipse UserFriend
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 174 times)
Re: Annotation to cause package import [message #1041734 is a reply to message #1041697] Mon, 15 April 2013 09:38 Go to previous messageGo to next message
Eclipse UserFriend
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 14:41 Go to previous message
Eclipse UserFriend
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: Tue Jul 22 19:04:51 EDT 2025

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

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

Back to the top