[izpack-devel] Heading panel, panels counter

Bartz, Klaus Klaus.Bartz at coi.de
Wed Jul 5 14:25:25 CEST 2006


Hi Fabrice,

>> A false written key will be create runtime errors.

oops, this is sometimes (or most?) not correct. Only some
keys creats runtime errors (my error).

<snip>
>
>I agree with you that the compatibility aspect, but regarding 
>validation
>it's quite important to have one.
>Couldn't we add maybe an error message specific to this 
>situation in order
>to be able to understand the reason of the error rather than 
>having a global
>runtime error which for most of the people doesn't make any sense...
>

Let us speak about <modifier> under <guipref>:
I think we have to differ between some possibilities:

1) There are keys which are used as switch: In the moment I test 

if( !((String) installdata.guiPrefs.modifier.get(<key name>))
                        .equalsIgnoreCase("yes")))
  do_nothing();

Possible to test also for "no" and throw an exception if the
key is defined but no allowed value is set.

2) After the principle switch is done, existent of keys has a meaning
if( caller.getI18nStringForClass(<key name>, null) == null) 
  do_nothing();

At this point I cannot throw an exception because the key self is
used as switch.

3) A wrong key triggers an runtime error. Example:
headingLines = Integer.parseInt((String) installdata.guiPrefs.modifier
  .get("headingLineCount"));
If the value is not an 	integer a NumberFormatException will be
thrown. I think this is OK. All installer builder should test
there installation. Then they see that there is a wrong number in
createHeading.

OK, it will be possible to add as comment the key name to an exception.


Also other participants of this list are invited at such a discussion :-)
IzPack can only be better with it.

Cheers

Klaus




More information about the izpack-devel mailing list