On May 21, 2007, at 11:09 AM, Paul Sandoz wrote:
> Marc Hadley wrote:
>> On May 19, 2007, at 10:32 AM, Jerome Louvel wrote:
>>>> I'm therefore not yet convinced that adding a declarative language
>>>> capability is that useful in practice. I think the above does
>>>> illustrate a need for a "QValuedCommaSeparatedList" type to aid in
>>>> parsing of the Accept-XXX headers though.
>>>
>>> Like you, I'm not sure yet about the practicality of declaring those
>>> metadata as annotations. However, I think that we should protect the
>>> resource code from client preferences considerations like parsing/
>>> analyzing
>>> the Accept* headers!
>>>
>> I think we can certainly help with the parsing as I suggested.
>
> Another way of thinking about this is to have isAcceptable and
> isNotAcceptable methods on say an 'AcceptableEvaluator' interface.
>
Interesting idea. Perhaps we could generalize the existing
ProconditionEvaluator interface:
https://jsr311.dev.java.net/sketches/sketch3/javax/ws/rs/core/
PreconditionEvaluator.html
Additional methods could be added to enable an application to
dynamically check if the available languages, encodings and charsets
meet the clients preferences or not.
Marc.
---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.
- application/pkcs7-signature attachment: smime.p7s