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  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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.
|
|
|
Goto Forum:
Current Time: Thu May 08 18:04:26 EDT 2025
Powered by FUDForum. Page generated in 0.05774 seconds
|