RE: [xml-dev] contradictory loader ordering in 3.5
Petr Kuzel <[email protected]> Fri, 21 Mar 2003 16:21:29 +0100
| Newsgroups | gmane.comp.java.netbeans.modules.xml.devel |
|---|---|
| Organization | CollabNet Hosting |
| Message-ID | <[email protected]> |
Richard Unger wrote:
> Sorry for all the posts.
On contrary, you are welcome. Your point of view is highly appreciated.
> Well, I was wrong, the TopologicalSortException came back, after 2 more
> restarts. So, now I tried a dummy data object. My loader looks like:
>
> public VoiceXMLDataLoader() {
> super("com.nuance.tools.voicexml.VoiceXMLDataLoader$DummyDataObject");
> }
>
> protected MultiDataObject createMultiObject (FileObject primaryFile)
> throws DataObjectExistsException
> {
> return new org.netbeans.modules.xml.core.XMLDataObject(primaryFile,
> this);
> }
>
> For now, that seems to have fixed everything. My loaders come up in the
> right order, and there doesn't seem to be any adverse effect to using this
> DummyDataObject. If there isn't something horrible I'm doing here without
> realizing, I'm going to stick with this solution.
>From DataLoader JavaDoc:
protected DataLoader(String representationClassName)
Create a new data loader. Pass its representation class name as a
parameter to the constructor. The constructor is then allowed to return
only subclasses of the representation class as the result of
findDataObject(org.openide.filesystems.FileObject,
org.openide.loaders.DataLoader.RecognizedFiles).
So it goes against contract. On the other hand you cannot
using manifest attributes order multiple loaders producing
the same data object class. So stick with it, but it
can break at any time in future. Anyway loaders are planned
to be replaced by Filesystem extensions concept
<http://openide.netbeans.org/proposals/fsextension/index.html>.
You should check if it fulfills all your requirements.
Do not hesitate to fill in IZ requests for missing concepts :-).
Cc.