Configuration
How to read a config
OptionsSheet mySheet = new OptionsSheet(); mySheet.load(new FileReader("path/to/file")); // Load from file // OR mySheet.load("configuration string"); // Load from string
How to write a config file
It is a little bit complicated.
+parseOption#separator#exUnknown#exMismatch name#type#incompatible#defaultVal#allowed#required#override#mismatch
The line which starts with + sets the options for the OptionsSheet.
Every other line represents an OptionsSheetEntry.
| Value | Meaning | Example value |
|---|---|---|
| OptionsSheet | ||
| parseOption | linux-like parsing or not | L => for linux-like, N => for other |
| separator | the character for key value pairs | = |
| exUnknown | Should an exception be thrown if an option was given which was not define in the OptionsSheet | false |
| exMismatch | Should the options be check if they are the right type | true |
| OptionsSheetEntry | ||
| name | the name of the option | black |
| type | the type of the option | BOOLEAN |
| incompatible | options which are incompatible to this one, separated by "," | brown,green,blue |
| defaultVal | the value this option has if not mentioned in query string | false |
| allowed | if you have type = SELECTION then this are the accepted values, separated by "," (enable type mismatch check) | yes,no |
| required | if this option is required | true |
| override | if the exMismatch should be overridden | false |
| mismatch | if you want to override the exMismatch value this is the new value for this option | false |
Comments