Re: JSR311: Re: ResponseBuilder

From: Stephan Koops <>
Date: Fri, 13 Jun 2008 15:58:13 +0200

> In the case of MediaType (likely the most common use case), the
> writeTo method has a mediaType parameter anyway.
Yes right, but the same is valid for the EntityTag.
> Using Object allows an application to set an arbitrary header using a
> custom Java type, if we always convert to string then an application
> supplied message body writer won't be able to take advantage of the
> custom type without first reparsing the string representation.
Also right.
> I could go either way on this one, both alternatives has plusses and
> minuses and its not clear to me that one is better than the other.
Ok, than leave it, as it is. But we have though abaout it. Perhaps a
hint in the javadoc ist good.
>> BTW: What should a HeaderDelegate do with a given null (in
>> valueOf(String) and in toString(T) )? It's not explicit defined in
>> the javadoc. For this case it is useful to allow null and return null
>> than, and not throw an IllegalArgumentException.
> I don't like that, null should be an error IMO - you can't parse it
> and you can't serialize it.
yes, you are right. I noticed, that it was escpeially for this usecase.
Anyhow: Please define what should happens with null in the javadoc of
the HeaderDelegate and in the methods [MediaType, CacheControl,