@Produces(value="application/json") @Provider public class EntityJSONWriter<T> extends AbstractWriter<T>
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.collections.Transformer |
entityToJSON
An
EntityToJson or JSONTransformer |
protected Class<T> |
type
If provided, will check the Entity or Collection
for type.
|
nullValueSupplierct, t| Constructor and Description |
|---|
EntityJSONWriter() |
| Modifier and Type | Method and Description |
|---|---|
protected net.sf.json.JsonConfig |
getConfig()
If
entityToJSON is defined then Use the return that else null |
org.apache.commons.collections.Transformer |
getEntityToJSON()
An
EntityToJson or JSONTransformer |
Class<T> |
getType()
If provided, will check the Entity or Collection
for type.
|
boolean |
isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
void |
setEntityToJSON(org.apache.commons.collections.Transformer entityToJSON)
An
EntityToJson or JSONTransformer |
void |
setType(Class<T> type)
If provided, will check the Entity or Collection
for type.
|
void |
writeTo(T t,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
OutputStream entityStream) |
getNullValueSupplier, getSize, setNullValueSupplierprotected org.apache.commons.collections.Transformer entityToJSON
EntityToJson or JSONTransformerprotected net.sf.json.JsonConfig getConfig()
entityToJSON is defined then Use the return that else nullgetConfig in class AbstractWriter<T>public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<T>isWriteable in class AbstractWriter<T>public void writeTo(T t, 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<T>writeTo in class AbstractWriter<T>IOExceptionjavax.ws.rs.WebApplicationExceptionpublic org.apache.commons.collections.Transformer getEntityToJSON()
EntityToJson or JSONTransformerpublic void setEntityToJSON(org.apache.commons.collections.Transformer entityToJSON)
EntityToJson or JSONTransformerpublic Class<T> getType()
Copyright © 2018. All rights reserved.