dev@jsr311.java.net

MessageBodyWorkers

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Tue, 25 Mar 2008 10:16:04 -0400

Currently we have methods to get a List of readers or writers for a
particular Java type and media type. Paul pointed out that providing a
List isn't particularly useful since there's no additional information
to drive the choice between members of the list and that generally
most folks will just take the first entry. Therefore we propose to
change the method signatures from:

public abstract <T> List<MessageBodyReader<T>>
getMessageBodyReaders(MediaType mediaType, Class<T> type, Type
genericType, Annotation annotations[]);
public abstract <T> List<MessageBodyWriter<T>>
getMessageBodyWriters(MediaType mediaType, Class<T> type, Type
genericType, Annotation annotations[]);

to

public abstract <T> MessageBodyReader<T>
getMessageBodyReader(MediaType mediaType, Class<T> type, Type
genericType, Annotation annotations[]);
public abstract <T> MessageBodyWriter<T>
getMessageBodyWriter(MediaType mediaType, Class<T> type, Type
genericType, Annotation annotations[]);

Any objections ?
Marc.

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.