user757364
user757364

Reputation: 1

java dyn parser

Im a novice java-programer, whos trying to create a small java app.

In the program im working on, I want to load the configurations from different ini-files. The basic idea is, that I would have a library containing all the config files, the parser should read all of them and make configurations named after their filenames. The parser should be created to work dynamicly, so it can read different types of configs. example

House.ini 
 -> type0 
 -> id  name  height  witdh  length   price_based_on_dimensions
 -> id1  name1  height  witdh  length   price_based_on_dimensions

These data should be saved to a config object named config.house. The tricky part is that a different config file, can have its type = type0 but with a different number of attributtes.

I realise that there is no simply solution to this, but any help and or guides to create a dynamic parser is welcome

Upvotes: 0

Views: 156

Answers (2)

Ryan Matthews
Ryan Matthews

Reputation: 1043

Other then ini4j (which is a really good library) I personally prefer to use xml config files. To me they are easier to use and allow for easier configuration

Upvotes: 0

Matt Ball
Matt Ball

Reputation: 359856

I'm not really clear on the output you want to produce, but a Java INI parsing library might be a good place to start. For that, you should use ini4j.

Upvotes: 2

Related Questions