@Provider @Produces(value="application/javascript") @ConstrainedTo(value=SERVER) public class JsonPProvider extends Object implements javax.ws.rs.ext.MessageBodyWriter<Object>
MediaType.APPLICATION_JSON_TYPE compatible types to JSONP. Restricted to media type
CustomMediaTypes.APPLICATION_JAVASCRIPT.
JSONP callback parameter name may be defined with the
org.rhq.metrics.restServlet.jsonp.JsonPProvider servlet context param. It defaults to
jsonp.
If the client does not provide a callback parameter, the provider will throw a WebApplicationException with
status code Response.Status.BAD_REQUEST.
| Constructor and Description |
|---|
JsonPProvider() |
| Modifier and Type | Method and Description |
|---|---|
long |
getSize(Object o,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
boolean |
isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
void |
writeTo(Object o,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
OutputStream entityStream) |
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<Object>public long getSize(Object o, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
getSize in interface javax.ws.rs.ext.MessageBodyWriter<Object>public void writeTo(Object o, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream) throws IOException, javax.ws.rs.WebApplicationException
writeTo in interface javax.ws.rs.ext.MessageBodyWriter<Object>IOExceptionjavax.ws.rs.WebApplicationExceptionCopyright © 2014–2015 Red Hat, Inc.. All rights reserved.