|
Re: [blueprints-emf] Question about generating models for blueprint and Jboss Errai [message #1626869 is a reply to message #1626808] |
Sat, 21 February 2015 07:02 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Anton,
Texo generates true java pojos from an ecore model:
https://wiki.eclipse.org/Texo
and you can convert between these pojos and EMF EObjects:
https://wiki.eclipse.org/Texo/Convert_to_EMF
Texo does not generate the Portable annotation but there is a way to specify these in the model and then they are placed
in the java code:
https://wiki.eclipse.org/Texo/Direct_Java_Annotations
gr. Martin
On 21-02-15 07:11, Anton Hughes wrote:
> I am using https://github.com/ghillairet/blueprints-emf - and am really impressed with it!
>
> My question is this - can I generate models that I can use in Jboss Errai and blueprint-emf?
>
> To elaborate - Errai, being a model-driven GWT based framework, expects Pojos that are annotated, like so - note the
> @Portable annotation:
>
> @Portable
> public class Person {
>
> private String name;
> private int age;
>
> public String getName() {
> return name;
> }
> public void setName(String name) {
> this.name = name;
> }
> public int getAge() {
> return age;
> }
> public void setAge(int age) {
> this.age = age;
> }
>
> }
>
>
> Do I have to generate two models - one POJO, with annotation, and another EObject based?
> If so, is there any convenient way to map between the two?
> Or can I customize the generated models to include this annotation, and if yes, how?
>
> Thanks and regards
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
|
|
Re: [blueprints-emf] Question about generating models for blueprint and Jboss Errai [message #1627020 is a reply to message #1626912] |
Sat, 21 February 2015 09:03 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Anton,
Hope that Ed sees this question, afaik there is no standard way to define a java annotation in an EAnnotation (but I
could be wrong).
But EMF allows you to customize templates:
https://wiki.eclipse.org/EMF/ExtendingCodeGeneration#Dynamic_Templates_.26_Generator_Adapter
So there you can also solve this.
gr. Martin
On 21-02-15 08:38, Anton Hughes wrote:
> Thanks Martin
>
> Yes I am aware - and really impressed - with your work.
> And I may well go with your suggestion.
>
> However, partly out of interest, and also to reduce dependencies/complexity, is it possible to add a class annotation
> using EAnnotation?
>
> I have read elsewhere on this forum that it is really easy to customize the generated code, and have seen people write
> of using Annotations to do this - but cannot find any documentation or tutorials for this.
> I would imagine annotating a class or method must be a common use-case. So I'm sure this would be easy to do with
> ecore/emf?
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03340 seconds