@Produces(value="application/json") @Provider public class TransformerWriter<T> extends Object implements javax.ws.rs.ext.MessageBodyWriter<T>, org.apache.commons.collections.Transformer
Collection
then the Transformer
will be applied to each element in the Collection
Modifier and Type | Field and Description |
---|---|
protected Supplier<String> |
nullValueSupplier
Supply a default Null value
|
Constructor and Description |
---|
TransformerWriter() |
TransformerWriter(org.apache.commons.collections.Transformer transformer) |
Modifier and Type | Method and Description |
---|---|
Supplier<String> |
getNullValueSupplier()
Supply a default Null value
|
long |
getSize(T t,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
Class<T> |
getSupportedType()
The
Class and its child types, this MessageBodyWriter will work for |
org.apache.commons.collections.Transformer |
getTransformer()
A
Transformer that returns a String or null
to write to the Response BufferedWriter |
boolean |
isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
void |
setNullValueSupplier(Supplier<String> nullValueSupplier)
Supply a default Null value
|
void |
setSupportedType(Class<T> supportedType)
The
Class and its child types, this MessageBodyWriter will work for |
void |
setTransformer(org.apache.commons.collections.Transformer transformer)
A
Transformer that returns a String or null
to write to the Response BufferedWriter |
Object |
transform(Object input) |
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) |
public TransformerWriter()
public TransformerWriter(org.apache.commons.collections.Transformer transformer)
public long getSize(T t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
getSize
in interface javax.ws.rs.ext.MessageBodyWriter<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>
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>
IOException
javax.ws.rs.WebApplicationException
public Object transform(Object input)
transform
in interface org.apache.commons.collections.Transformer
public org.apache.commons.collections.Transformer getTransformer()
Transformer
that returns a String or null
to write to the Response BufferedWriter
public void setTransformer(org.apache.commons.collections.Transformer transformer)
Transformer
that returns a String or null
to write to the Response BufferedWriter
public Class<T> getSupportedType()
Class
and its child types, this MessageBodyWriter
will work forpublic void setSupportedType(Class<T> supportedType)
Class
and its child types, this MessageBodyWriter
will work forpublic Supplier<String> getNullValueSupplier()
Copyright © 2018. All rights reserved.