I want to create a class with Eclipse EMF that contains a List with String objects. I see that Ecore has an EList but I can’t change the generic type of the list.
Any idea how to do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to generate code that gives you an
EList<String>, then add a newEAttributeto anEClass, give it theETypeEString, and set its “Upper Bound” property to ‘-1’.If you want to create such a list programmatically, you could use the
BasicEListfor example (org.eclipse.emf.common.util.BasicEList<E>):If you want to see your other options, open the type hierarchy on:
org.eclipse.emf.common.util.AbstractEList<E>