commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <bay...@generationjava.com>
Subject Re: [cli] Suggestions
Date Fri, 15 Nov 2002 07:25:13 GMT


On Fri, 15 Nov 2002, Martin Redington wrote:

> Hi John,
>
> >> 5. During interrogation, option values are retrieved via
> >> booleanValue, stringValue, etc. calls. These are "type-safe", in that
> >> trying to retrieve a boolean value from an integer option will throw
> >> a runtime-exception, which will be thrown the first time that the
> >> program is run
> >> (assuming, reasonably that you go through a create/parse/query phase
> >> early in program initialisation).
> >
> > The TypeHandler class does provide support for this at the
> > interrogation
> > stage.  Have a look at it and tell me if there is anything you think is
> > missing.
>
> I'll check it out ...

I was in the same position as yourself a while back. I had my own library
and wanted to dump it for CLI but CLI lacked this feature. I wanted to do:

 flags = "a:bc%d/"   which means d is a File, c a Number, c a boolean and
a a String.

PatternOptionsBuilder does this and uses TypeHandler to do its dumbie
conversions. BeanUtils has a converter package that realy should become
more highprofile and CLI would use this for its conversion.

I think :) It's been way down on my todo lists :(

Hen


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message