Skip to main content



      Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Custom import from java annotations
Custom import from java annotations [message #131138] Wed, 03 December 2008 14:58 Go to next message
Eclipse UserFriend
I'd like to be able to import all classes and attributes from a specific
package and I'd like to avoid having to add manually @model to each element.
Is there an easy way to do that?
Re: Custom import from java annotations [message #131214 is a reply to message #131138] Thu, 04 December 2008 08:10 Go to previous messageGo to next message
Eclipse UserFriend
Erik,

No, we don't have a way to do that. It would for sure be very useful to
have something like this. I.e., some type of wizard that would gather
up all the potential model information and then let you edit it. It
would kind of need to be smart though, because if you put @model on a
setX method, it will become an operation when likely, if there is a getX
method, you'd not even want the @model on the setX because it's just the
set accessor for the "X" feature. It's not likely this will ever exist
unless someone contributes it...


Erik Putrycz wrote:
> I'd like to be able to import all classes and attributes from a
> specific package and I'd like to avoid having to add manually @model
> to each element.
> Is there an easy way to do that?
Re: Custom import from java annotations [message #131308 is a reply to message #131214] Thu, 04 December 2008 12:52 Go to previous messageGo to next message
Eclipse UserFriend
Ed Merks wrote:
> Erik,
>
> No, we don't have a way to do that. It would for sure be very useful to
> have something like this. I.e., some type of wizard that would gather
> up all the potential model information and then let you edit it. It
> would kind of need to be smart though, because if you put @model on a
> setX method, it will become an operation when likely, if there is a getX
> method, you'd not even want the @model on the setX because it's just the
> set accessor for the "X" feature. It's not likely this will ever exist
> unless someone contributes it...

To start, do you know where the "import from annotation" is implemented?
I don't think the set/get should be too difficult to handle, also there
is more custom stuff I'd like to import in the model such as java 5
annotation...

Erik.
Re: Custom import from java annotations [message #131321 is a reply to message #131308] Thu, 04 December 2008 12:59 Go to previous message
Eclipse UserFriend
Erik,

All the magic happens in
org.eclipse.emf.importer.java.builder.JavaEcoreBuilder. A brute force
approach might be to make it behave as if everything had @model on it
and then filter down the result...


Erik Putrycz wrote:
> Ed Merks wrote:
>> Erik,
>>
>> No, we don't have a way to do that. It would for sure be very useful
>> to have something like this. I.e., some type of wizard that would
>> gather up all the potential model information and then let you edit
>> it. It would kind of need to be smart though, because if you put
>> @model on a setX method, it will become an operation when likely, if
>> there is a getX method, you'd not even want the @model on the setX
>> because it's just the set accessor for the "X" feature. It's not
>> likely this will ever exist unless someone contributes it...
>
> To start, do you know where the "import from annotation" is implemented?
> I don't think the set/get should be too difficult to handle, also
> there is more custom stuff I'd like to import in the model such as
> java 5 annotation...
>
> Erik.
Re: Custom import from java annotations [message #620423 is a reply to message #131138] Thu, 04 December 2008 08:10 Go to previous message
Eclipse UserFriend
Erik,

No, we don't have a way to do that. It would for sure be very useful to
have something like this. I.e., some type of wizard that would gather
up all the potential model information and then let you edit it. It
would kind of need to be smart though, because if you put @model on a
setX method, it will become an operation when likely, if there is a getX
method, you'd not even want the @model on the setX because it's just the
set accessor for the "X" feature. It's not likely this will ever exist
unless someone contributes it...


Erik Putrycz wrote:
> I'd like to be able to import all classes and attributes from a
> specific package and I'd like to avoid having to add manually @model
> to each element.
> Is there an easy way to do that?
Re: Custom import from java annotations [message #620510 is a reply to message #131214] Thu, 04 December 2008 12:52 Go to previous message
Eclipse UserFriend
Ed Merks wrote:
> Erik,
>
> No, we don't have a way to do that. It would for sure be very useful to
> have something like this. I.e., some type of wizard that would gather
> up all the potential model information and then let you edit it. It
> would kind of need to be smart though, because if you put @model on a
> setX method, it will become an operation when likely, if there is a getX
> method, you'd not even want the @model on the setX because it's just the
> set accessor for the "X" feature. It's not likely this will ever exist
> unless someone contributes it...

To start, do you know where the "import from annotation" is implemented?
I don't think the set/get should be too difficult to handle, also there
is more custom stuff I'd like to import in the model such as java 5
annotation...

Erik.
Re: Custom import from java annotations [message #620511 is a reply to message #131308] Thu, 04 December 2008 12:59 Go to previous message
Eclipse UserFriend
Erik,

All the magic happens in
org.eclipse.emf.importer.java.builder.JavaEcoreBuilder. A brute force
approach might be to make it behave as if everything had @model on it
and then filter down the result...


Erik Putrycz wrote:
> Ed Merks wrote:
>> Erik,
>>
>> No, we don't have a way to do that. It would for sure be very useful
>> to have something like this. I.e., some type of wizard that would
>> gather up all the potential model information and then let you edit
>> it. It would kind of need to be smart though, because if you put
>> @model on a setX method, it will become an operation when likely, if
>> there is a getX method, you'd not even want the @model on the setX
>> because it's just the set accessor for the "X" feature. It's not
>> likely this will ever exist unless someone contributes it...
>
> To start, do you know where the "import from annotation" is implemented?
> I don't think the set/get should be too difficult to handle, also
> there is more custom stuff I'd like to import in the model such as
> java 5 annotation...
>
> Erik.
Previous Topic:Value holding in CDO model
Next Topic:EList performance issues
Goto Forum:
  


Current Time: Thu May 08 18:04:26 EDT 2025

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

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

Back to the top