You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mime4j-dev@james.apache.org by Markus Wiederkehr <ma...@gmail.com> on 2009/01/30 16:06:42 UTC

Field/FieldParser: hide implementation details

In package o.a.j.mime4j.field we have the FieldParser interface;
DelegatingFieldParser, DefaultFieldParser and a lot of static inner
class of the various Field classes implement this interface..

Class Field has a getter to retrieve the DefaultFieldParser but there
is no way to change that default value. So what's the point of this
getter?

IMO interface FieldParser and all of its implementations should not be
part of the public API..

Any objections to making them package-private?

Markus

Re: Field/FieldParser: hide implementation details

Posted by Robert Burrell Donkin <ro...@gmail.com>.
On Sun, Feb 1, 2009 at 8:16 PM, Markus Wiederkehr
<ma...@gmail.com> wrote:
> On Fri, Jan 30, 2009 at 4:06 PM, Markus Wiederkehr
> <ma...@gmail.com> wrote:
>> In package o.a.j.mime4j.field we have the FieldParser interface;
>> DelegatingFieldParser, DefaultFieldParser and a lot of static inner
>> class of the various Field classes implement this interface..
>>
>> Class Field has a getter to retrieve the DefaultFieldParser but there
>> is no way to change that default value. So what's the point of this
>> getter?
>
> Okay, the original intention was probably to retrieve the
> DefaultFieldParser from Field and then register additional parsers via
> DelegatingFieldParser.setFieldParser(String name, FieldParser
> parser)...

AIUI yes

> Still, the inner static Parser classes of MailboxField et al could
> become package-private..

+1

- robert

Re: Field/FieldParser: hide implementation details

Posted by Markus Wiederkehr <ma...@gmail.com>.
On Fri, Jan 30, 2009 at 4:06 PM, Markus Wiederkehr
<ma...@gmail.com> wrote:
> In package o.a.j.mime4j.field we have the FieldParser interface;
> DelegatingFieldParser, DefaultFieldParser and a lot of static inner
> class of the various Field classes implement this interface..
>
> Class Field has a getter to retrieve the DefaultFieldParser but there
> is no way to change that default value. So what's the point of this
> getter?

Okay, the original intention was probably to retrieve the
DefaultFieldParser from Field and then register additional parsers via
DelegatingFieldParser.setFieldParser(String name, FieldParser
parser)...

Still, the inner static Parser classes of MailboxField et al could
become package-private..

Markus