@Provider @Produces(value="application/json") public class JsonCollectionWriter extends Object implements javax.ws.rs.ext.MessageBodyWriter<Object>
Modifier and Type | Field | Description |
---|---|---|
protected MarshallerRegistry |
m_marshallerRegistry |
Marshaller registry to obtain element marshallers from.
|
Constructor | Description |
---|---|
JsonCollectionWriter() |
Default constructor.
|
JsonCollectionWriter(MarshallerRegistry registry) |
Construct a JsonCollectionWriter instance.
|
Modifier and Type | Method | Description |
---|---|---|
long |
getSize(Object col,
Class<?> clz,
Type type,
Annotation[] aAnnotation,
javax.ws.rs.core.MediaType mediaType) |
|
boolean |
isWriteable(Class<?> clz,
Type type,
Annotation[] aAnnotation,
javax.ws.rs.core.MediaType mediaType) |
|
void |
writeTo(Object oCol,
Class<?> clz,
Type type,
Annotation[] aAnnotation,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
OutputStream stream) |
@Inject protected MarshallerRegistry m_marshallerRegistry
public JsonCollectionWriter()
public JsonCollectionWriter(MarshallerRegistry registry)
registry
- marshaller registry to usepublic boolean isWriteable(Class<?> clz, Type type, Annotation[] aAnnotation, javax.ws.rs.core.MediaType mediaType)
isWriteable
in interface javax.ws.rs.ext.MessageBodyWriter<Object>
public long getSize(Object col, Class<?> clz, Type type, Annotation[] aAnnotation, javax.ws.rs.core.MediaType mediaType)
getSize
in interface javax.ws.rs.ext.MessageBodyWriter<Object>
public void writeTo(Object oCol, Class<?> clz, Type type, Annotation[] aAnnotation, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream stream) throws IOException, javax.ws.rs.WebApplicationException
writeTo
in interface javax.ws.rs.ext.MessageBodyWriter<Object>
IOException
javax.ws.rs.WebApplicationException