commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Siebert <smsi...@gmail.com>
Subject Re: [cli] Why is the Constructor to CommandLine package protected?
Date Wed, 29 Sep 2010 00:45:26 GMT
Hi Jason,

You're right, the CommandLine constructor is package-private (default)
access and therefore can't be extended outside the package.  I don't think
this was the intent of the developers, since the CommandLine and
CommandLineParser classes are not marked final.

I attached a quick patch, if the comitters wish to implement.  You'll need
to realize the CommandLineParser interface in another class to return your
custom CommandLine type, of course, and you should keep the constructor
protected/private =).

Cheers,

Steve


On Tue, Sep 28, 2010 at 8:16 PM, Jason Powers <jpower2@gmail.com> wrote:

> Hi,
> I'm working with version 1.2 (I've checked the 1.3 source as well) and I'm
> in need of writing a parser that's a little more strict than the provided
> parsers. I really like the rest of the framework, but if I can't
> instantiate
> a CommandLine object without being in the same package I can't extend it
> very well.
>
> Is there a reason that this is protected that I'm just not seeing?
>
> Thanks
> Jason
>

Mime
View raw message