Hi,
I am using EMF through annotated Java code as following
/**
* Adds the given type to this filter. Has no effect if the given type
* already belongs to this filter.
*
* @param type
* the type to add
* @model
*/
public void addEntityType(String type);
/**
* Returns the list of types belonging to this filter. Types are identified
* by there name.
*
* @return the list of types for this entity type filter
*
* @model
*/
public List<String> getEntityTypes();
/**
* Removes the given type from this filter. Has no effect if the given type
* doesn't belong to this filter.
*
* @param type
* the type to remove
* @model
*/
public void removeEntityType(String type);
After creating ecore and genmodel files from this annotated interface, and after generating code the getEntityTypes method is modified as following:
public EList<String> getEntityTypes();
For encapsulation purpose I want this EList to be unmodifiable, thus the interface client's code can only modify the list through add and remove methods.
Is there any clean way to do that I.e modifying Java annotation or the genmodel file to tell the generator to generate code returning unmodifiable list ? (I was unable to find that after googling ...)
How do you manage such situations ?
Thanks in advance
Manu