Top Description Methods
javax.ws.rs

public @Interface Consumes

extends Annotation
Annotations
@Inherited
@Target:TYPE, METHOD
@Retention:RUNTIME
@Documented
Imports
java.lang.annotation.Documented, .ElementType, .Inherited, .Retention, .RetentionPolicy, .Target

Defines the media types that the methods of a resource class or javax.ws.rs.ext.MessageBodyReader can accept. If not specified, a container will assume that any media type is acceptable. Method level annotations override a class level annotation. A container is responsible for ensuring that the method invoked is capable of consuming the media type of the HTTP request entity body. If no such method is available the container must respond with a HTTP "415 Unsupported Media Type" as specified by RFC 2616.
Authors
Paul Sandoz, Marc Hadley
Since
1.0
See Also
javax.ws.rs.ext.MessageBodyReader

Method Summary

Modifier and TypeMethod and Description
public String[]
value()

A list of media types.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public String[] value()

A list of media types. Each entry may specify a single type or consist of a comma separated list of types, with any leading or trailing white-spaces in a single type entry being ignored. For example:

 {"image/jpeg, image/gif ", " image/png"}
Use of the comma-separated form allows definition of a common string constant for use on multiple targets.