Getter/Setter methods when dynamically build the model [message #431896] |
Tue, 28 July 2009 16:40  |
Eclipse User |
|
|
|
I successfully built a model programatically in the memory(A bunch of
EClass), then an instance tree is created according to the in-memory
model(A bunch of EObject). My issue is: I want those EObjects generated
to have all the getter/setters for the public attribute. How do I force
the model to generate getter/setter?
|
|
|
|
|
|
|
Re: Getter/Setter methods when dynamically build the model [message #431950 is a reply to message #431929] |
Thu, 30 July 2009 09:53  |
Eclipse User |
|
|
|
Alicl,
Comments below.
Alick wrote:
> Appreciate your comments, let me try to put the question differently.
> My intention is: After everything is done, in the program that is to
> traverse the instance (EObject tree)which is spawn off the in-memory
> extended model (EClass-es), it would be really intuitive that all the
> accessors can be visible to the devlopers in the drop-down list.
Use eObject.eClass().getEAllStructuralFeatures() to build that list.
> Currently because the EClass from which the EObject is spawn off
> doesn't have accessors(), the coder has no choice othen than
> eGet/eSet, but it requires the coder to know the exact structure of
> the in-memory extended model. Hope I explained clear this time, thanks
In the end, it sounds like you want to generate code and after that's
done, someone will use that generated model. The existing Ant tasks
suppose such a thing so you can reuse that directly or look at it as an
example of how to drive the generator programmatically.
>
> Alicl
|
|
|
Powered by
FUDForum. Page generated in 1.60651 seconds