Captain Awesome's ResourceFactory

Hello!
I have tried a lot of different resource loaders (that loads objects from xml), however I never found one that suited my needs. I didn’t want to extend another class, I didn’t want to create other objects in order to get my final object. All I wanted was to call one method and get the complete object without any hassle.

That’s when I started working on my own resourceloader. My ResourceFactory can load .xml files from InputStreams, files and urls. It supports parenting, objects within objects and java.util.List.
You can download it at: http://www.trololol.se/java/
There is also a tutorial there which explains everything in detail.

If you have any questions or suggestions, feel free to post them here.

Woops, I see I might have posted this in the wrong section. Could a mod move it to “Engines, Libraries and Tools” board?

What about this, http://xstream.codehaus.org/?

I think he is not after a deserialization system, but wants to have some sort of registry for him to create predefined resources on demand, so xstream won’t cut it.

Yeah, that is pretty much what I wanted to do

I just released an update to this, which includes some methods to add, remove and save nodes within java. Also, you can now specify a method which will be run when an object is created.

Also, I’m releasing the source code here: http://www.trololol.se/java/ResourceFactory.rar. You may do whatever you want with it :slight_smile:

Have fun

I don’t see how what Captain Awesome is doing is any different than Xstream or other serialization.