次のように、注釈付きのJavaコードを介してEMFを使用しています
/**
* 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);
この注釈付きインターフェースから ecore および genmodel ファイルを作成した後、コードを生成した後、getEntityTypes メソッドは次のように変更されます。
public EList<String> getEntityTypes();
カプセル化の目的で、この EList を変更できないようにしたいので、インターフェイス クライアントのコードは add メソッドと remove メソッドを介してのみリストを変更できます。
つまり、Java アノテーションまたは genmodel ファイルを変更して、変更不可能なリストを返すコードを生成するようにジェネレーターに指示する方法はありますか? (ググっても見つけられませんでした…)
そのような状況をどのように管理しますか?
前もって感謝します
マヌー