Parsing Config Files

I wasn't sure where to put this, but I hope this is the proper place. I'm just delving into the jMonkey world and might pester these forums with some questions, seeing it's been a while since I did some java programming.  :slight_smile:

Now, to get off to a light start, I wanted to create (well, extend whats already there of course) an input manager for a jMonkey based game/tool. I want to read in settings from a file, and am wondering whether there already is support for this in the engine, or if people just write their own parsers, use other existing ones, or do some sort of serialization/xml magic. I've seen xml parsing in the model load/export/convert section, but I guess I am after something more general since I basically want to be able to link keys or other input to certain actions through the use of a config file.

Just want to know what's there so I can choose what suits me best at the moment. Worst case scenario, I'll just write my own parser, but I just thought reinventing the wheel, if avoidable, is a good thing. Cheers!

Actually I think there's already a GameState based input manager (made by darkfrog), which has a UI part, but also an abstracted (at least I'd hope so!) configuration part… not sure what class or package it is though (surely someone will be able to tell you though)

Thanks. I feel I might have jumped to questions a bit fast, just discovered the com.jme.input.controls.binding package as well as PreferenceGameSettings which seem to be  providing an abstraction of all this input/output including the parsing. I'll take a look and get back when I feel lost or have something to add. If someone has any general hints/tips regarding this area, it is still very welcome.  :wink:

Java provides access to the registry with the Preferences class (which PreferencesGameSettings uses), you can also the Properties class for parsing simple config files like you mentioned.

Yes, these are the packages I was refering too… I'm sure you'll find something to do though :slight_smile: