|
Re: EClass loading parameters dynamically from an XML file [message #654091 is a reply to message #654089] |
Mon, 14 February 2011 07:33 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Lior,
Comments below.
Lior wrote:
> Hi Everyone,
> I have an EClass that needs to acquire some parameters (for example,
> some command file parameters or parameters that exists in an XML file)
> dynamically.
I'm not sure I really understand what this means...
> As a newbie , I'm interested in your opinion - what's the best way to
> do it? which data structure fits best here?
An EClass for a generated model is generally a static thing that's best
not modified. Of course you can associate things with it in the normal
Java way, i.e., with a map that has the EClass as the key...
> I thought about an HashMap<String,String>, or eAnnotation.
EAnnotations are generally static information associated with the class,
not dynamic information... Certainly it's possible for an EAnnotation
use it's references feature to refer to EObjects in some other resource,
but I'm not sure that's really what you want; you'd need to use dynamic
package loading (GenPackage options) to support that...
> In Addition, is there any established way to load objects dynamically
> to an EClass object?
No. You should think of this as similar to wanting to load dynamic
objects to a java.lang.Class, i.e., you generally can't and don't...
>
> Thanks,
> Lior
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03614 seconds