Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » J2SE 5.0 annotations
J2SE 5.0 annotations [message #392465] Thu, 21 April 2005 14:19 Go to next message
Kanstantsin Chernysh is currently offline Kanstantsin ChernyshFriend
Messages: 8
Registered: July 2009
Junior Member
Hi.

I am creating ecore model programmatically. My code looks like the
following

EcoreFactory ecoreFactory = EcoreFactoryImpl.eINSTANCE;
EcorePackage ecorePackage = EcorePackage.eINSTANCE;

EPackage testPackage = ecoreFactory.createEPackage();
EClass testClass = ecoreFactory.createEClass();
testClass.setName("Test");
testPackage.getEClassifiers().add(testClass);
EAttribute testAttribute = ecoreFactory.createEAttribute();
testAttribute.setName("name");
testAttribute.setEType(EcorePackage.eINSTANCE.getEString());
...

How can I create "annotation" elements in order to get following annotated
java code after code generation.

@Entity(access = AccessType.FIELD)
public class TestImpl extends EObjectImpl implements Test {

@Transient
String name = NAME_EDEFAULT;
...
}
Re: J2SE 5.0 annotations [message #392469 is a reply to message #392465] Thu, 21 April 2005 15:44 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Kanstantsin,

There is no way to achieve this result with the current implementation
which relies on JDT's JDOM which does not support Java 1.5. We won't
even begin to look at Java 1.5 support until we start work on EMF 2.2 in
the summer. Sorry.


Kanstantsin Chernysh wrote:

> Hi.
>
> I am creating ecore model programmatically. My code looks like the
> following
>
> EcoreFactory ecoreFactory = EcoreFactoryImpl.eINSTANCE;
> EcorePackage ecorePackage = EcorePackage.eINSTANCE;
>
> EPackage testPackage = ecoreFactory.createEPackage();
> EClass testClass = ecoreFactory.createEClass();
> testClass.setName("Test");
> testPackage.getEClassifiers().add(testClass);
> EAttribute testAttribute = ecoreFactory.createEAttribute();
> testAttribute.setName("name");
> testAttribute.setEType(EcorePackage.eINSTANCE.getEString());
> ...
>
> How can I create "annotation" elements in order to get following
> annotated java code after code generation.
>
> @Entity(access = AccessType.FIELD)
> public class TestImpl extends EObjectImpl implements Test {
>
> @Transient
> String name = NAME_EDEFAULT;
> ..
> }
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:nsURI Problem
Next Topic:Binary Serialization
Goto Forum:
  


Current Time: Thu Apr 18 09:59:26 GMT 2024

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

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

Back to the top