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.

ValueMeaningExample value
OptionsSheet
parseOptionlinux-like parsing or notL => for linux-like, N => for other
separatorthe character for key value pairs=
exUnknownShould an exception be thrown if an option was given which was not define in the OptionsSheetfalse
exMismatchShould the options be check if they are the right typetrue
OptionsSheetEntry
namethe name of the optionblack
typethe type of the optionBOOLEAN
incompatibleoptions which are incompatible to this one, separated by ","brown,green,blue
defaultValthe value this option has if not mentioned in query stringfalse
allowedif you have type = SELECTION then this are the accepted values, separated by "," (enable type mismatch check)yes,no
requiredif this option is requiredtrue
overrideif the exMismatch should be overriddenfalse
mismatchif you want to override the exMismatch value this is the new value for this optionfalse

Comments

Posts Quoted:
Reply
Clear All Quotes