Hi Erick,
On Jan 26, 2009, at 4:17 AM, Erick Dovale wrote:
> Hi,
> Can anyone explain what annotations are passed in the Annotation[]
> parameter in the readFrom method in MessageBodyReader?
> I can't understand the javadoc; this is what it says:
>
> an array of the annotations on the declaration of the artifact that
> will be initialized with the produced instance. E.g. if the message
> body is to be converted into a method parameter, this will be the
> annotations on that parameter returned by
> <code>Class.getParameterAnnotations</code>.
>
> First, I could not find such method in java.lang.Class.
> Am I missing something?? or this javadoc a bit screwy?
>
Bug in the JavaDoc. It should be "Method.getParameterAnnotations"
If there is a resource method say:
@POST
public void post(@QueryParam String a, @XYZ @ABC MyType entity)
{ ... }
Then the parameter "entity" is selected to be the parameter that the
request entity will be serialized to with the selected message body
writer. The array of annotations will be those declared on the
parameter "entity".
Paul.