Package org.apache.hadoop.lib.wsrs
Class JSONProvider
java.lang.Object
org.apache.hadoop.lib.wsrs.JSONProvider
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyWriter<org.json.simple.JSONStreamAware>
@Provider
@Produces("application/json; charset=utf-8")
@Private
public class JSONProvider
extends Object
implements javax.ws.rs.ext.MessageBodyWriter<org.json.simple.JSONStreamAware>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetSize(org.json.simple.JSONStreamAware jsonStreamAware, Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) booleanisWriteable(Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) voidwriteTo(org.json.simple.JSONStreamAware jsonStreamAware, Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String, Object> stringObjectMultivaluedMap, OutputStream outputStream)
-
Constructor Details
-
JSONProvider
public JSONProvider()
-
-
Method Details
-
isWriteable
public boolean isWriteable(Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) - Specified by:
isWriteablein interfacejavax.ws.rs.ext.MessageBodyWriter<org.json.simple.JSONStreamAware>
-
getSize
public long getSize(org.json.simple.JSONStreamAware jsonStreamAware, Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) - Specified by:
getSizein interfacejavax.ws.rs.ext.MessageBodyWriter<org.json.simple.JSONStreamAware>
-
writeTo
public void writeTo(org.json.simple.JSONStreamAware jsonStreamAware, Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String, Object> stringObjectMultivaluedMap, OutputStream outputStream) throws IOException, javax.ws.rs.WebApplicationException- Specified by:
writeToin interfacejavax.ws.rs.ext.MessageBodyWriter<org.json.simple.JSONStreamAware>- Throws:
IOExceptionjavax.ws.rs.WebApplicationException
-