commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bob mcwhirter <...@werken.com>
Subject Re: [CLI] valid option character(s)
Date Mon, 29 Jul 2002 01:23:55 GMT
On Sun, 28 Jul 2002, John Keyes wrote:

> On Sunday, July 28, 2002, at 03:45 , John Keyes wrote:
> 
> > I am implementing some validation for Option creation.  The current
> > rules are simple, if the description or option are null or have a length
> > of 0 then throw an IllegalArgumentException.
> 
> This creates a problem for the PatternOptionBuilder as it creates options
> without descriptions.  I think its important to emphasise the importance
> of descriptions so I do think to throw an IllegalArgumentException is
> correct.  As PatternOptionBuilder is an extraordinary usage possibly the
> thing to do here is to subclass Option (PatternOption) which does absorbs
> the IllegalArgumentException being thrown.

Or, make the validity-check external to the Option itself.  Put it in
the builder.  Then, the PatternOptionBuilder could just avoid checking
for descriptions.

Or, have a 2-part validity check on Option.

Option::isFunctionallyValid() and Option::hasAllTheBellsAndWhistles()

	-bob


--
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