> It could have methods starting with "append" like the StringBuilder
> class,
> and follow the Reference naming convention. For example it could have:
>
> - appendScheme(String scheme)
> - appendSchemeSpecificPart(String ssp)
> - appendFragment(String fragment)
> - appendHierarchicalPart(String ssp)
> - appendAuthority(String authority)
> - appendPath(String path)
> - appendSegment(String segment)
> - appendMatrixParam(String name, String value)
> - appendQuery(String query)
> - appendQueryParam(String name, String value)
> Except it's not "append": it's "insert into the right place" or "set".
Agreed. Some of the fields would require a setter, some an appender.
You would really only append query fields and paths.
I have a same class already working, I'll create an RFE and attach a
complete patch.
Kevin
On Nov 29, 2007 6:41 PM, Paul J. Lucas <[EMAIL PROTECTED]> wrote:
> On Nov 29, 2007, at 3:18 PM, Jerome Louvel wrote:
>
> > It could have methods starting with "append" like the StringBuilder
> > class,
> > and follow the Reference naming convention. For example it could have:
> >
> > - appendScheme(String scheme)
> > - appendSchemeSpecificPart(String ssp)
> > - appendFragment(String fragment)
> > - appendHierarchicalPart(String ssp)
> > - appendAuthority(String authority)
> > - appendPath(String path)
> > - appendSegment(String segment)
> > - appendMatrixParam(String name, String value)
> > - appendQuery(String query)
> > - appendQueryParam(String name, String value)
>
> Except it's not "append": it's "insert into the right place" or "set".
>
> > It should force the reference to be built in the correct order so an
> > efficient StringBuilder could be used internally and should guide the
> > developer with clear warning messages when parts are not appended
> > in the
> > right order.
>
> Why should it enforce the order? The burden should be on the
> implementor, not the user. Don't use a StringBuilder: use simple
> fields:
>
> class URI {
> private String scheme;
> private String host;
> // ...
> }
>
> - Paul
>