|
Re: Registering a resource factory on a file name [message #399096 is a reply to message #399092] |
Tue, 07 March 2006 12:01 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Paul,
You can register a factory for *.xml by extending the existing
XMLResourceFactoryImpl and overriding createResource to do something
special for certain special files and call super for the rest.
Paul Fullbright wrote:
> I dredged this up from the depths (dated Tue, 13 Apr 2004):
>
>> Stefan,
>>
>> We may consider adding support for this to Resource.Factory.Registry
>> in the
>> future. For now you can override
>> ResourceFactoryRegistryImpl.getFactory() to
>> detect this case.
>>
>>
>> Stefan wrote:
>>
>> > Hi,
>> >
>> > I'd like to use my own resource / resource factory implementation for
>> > ejb-jar.xml files. Of course I don't want to register the factory
>> on the
>> > ".xml" file extension, and I also don't want to invent my own URI
>> protocol
>> > for this, but use standard 'file:' URIs. Is it possible to register a
>> > factory on a complete file name instead, i.e. "ejb-jar.xml" ? Which
>> EMF
>> > class would I need to subclass for accomplishing this?
>> >
>> > bye,
>> > Stefan
>
> I have the exact same question. I want to do this for my particular
> foo.xml file, but I don't want to register the factory on the entire
> ".xml" extension. Is there now extended support for this?
>
> - Paul
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Re: Registering a resource factory on a file name [message #399423 is a reply to message #399422] |
Thu, 16 March 2006 20:42 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Paul,
You'd register it only local to your resource set where you have
complete control, not in the global registry that effects everyone,
which would be very rude indeed!
Paul Fullbright wrote:
> Ed Merks wrote:
>
>> Paul,
>
>> You can register a factory for *.xml by extending the existing
>> XMLResourceFactoryImpl and overriding createResource to do something
>> special for certain special files and call super for the rest.
>
> Hi Ed,
>
> Isn't that a bit impolite? How about the others out there using the
> .xml extension? Won't I potentially be replacing somebody else's use
> of an extension of XMLResourceFactoryImpl?
>
> For instance, if somebody is trying to do something similar for
> foo.xml, and they implement FooXMLResourceFactoryImpl, which they then
> register to the *.xml extension, which factory would be retrieved in
> the lookup for an *.xml file? Theirs or mine?
>
> - Paul
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03288 seconds