[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.epf] Re: Getting RoleSets from XMI files

Quentin,

Comments below.

Quentin DEME wrote:
Thank you for your reply,

You said that I should avoid using Impl classes, but when I use getAllContents(), I only get Impl classes.
Yes, you get implementation classes of the public APIs. But that doesn't mean you show be using those implementation classes in your code. Similarly if you use an IFile, you'll end up with File implementation class that you cannot use in your code because it's not exported by the plugin.

And, when I have an instance of RoleDescriptorImpl for example, I can use RoleDescriptorImpl.getRole(), to get a "Role" class. So, in any cases, I never get the "RoleDescriptor" class.
I think you're overlooking thef act that RoleDescriptorImpl implements the RoleDescriptor interface and that the interface is the public API you should be using.

How can I get this kind of classes ?
The same way you got the Impl classes, but from the Java package that has the API rather than the Java package that contains all the implementation classes for that API.

I tried resourceSet.getAllContents(), but I get approximatively the same results than before, because I apparently have only one resource.
This seems to imply there is only one resource and it does not contain any of the data of the type you are looking for nor does it contain reference to other resources. Does that make sense?

Also, I can list guidelines from phases for example, but is it possible to get all the guidelines independantly of the components they belong to ? (all in the same iteration)
It seems to me your approach of visiting the whole resource would be the way, but given my complete lack of knowledge about the model I can only make guesses. What kind of relationship gets you from a phrase to a guideline and how does that relate to this RoleSet thing... You might just try to print out every "o" you visit to get a better sense of all the objects contained in the resource...

Thank you,

Quentin