@Provider public class TemplateMessageBodyWriter extends Object implements javax.ws.rs.ext.MessageBodyWriter<String>
text/html
or text/xhtml+xml
is requested as a content type.
Exceptions thrown by the templating engine are properly translated to responses via a TemplateExceptionMapper
.TemplateExceptionMapper
,
TemplateMessageBodyWriter
Constructor and Description |
---|
TemplateMessageBodyWriter() |
Modifier and Type | Method and Description |
---|---|
long |
getSize(String t,
Class<?> type,
Type type1,
Annotation[] antns,
javax.ws.rs.core.MediaType mt)
Return the size of the response.
|
boolean |
isWriteable(Class<?> type,
Type t,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType)
We can process only objects for which templates exist.
|
void |
writeTo(String t,
Class<?> type,
Type type1,
Annotation[] antns,
javax.ws.rs.core.MediaType mt,
javax.ws.rs.core.MultivaluedMap<String,Object> mm,
OutputStream out) |
public boolean isWriteable(Class<?> type, Type t, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
isWriteable
in interface javax.ws.rs.ext.MessageBodyWriter<String>
type
- t
- annotations
- mediaType
- public long getSize(String t, Class<?> type, Type type1, Annotation[] antns, javax.ws.rs.core.MediaType mt)
getSize
in interface javax.ws.rs.ext.MessageBodyWriter<String>
t
- type
- type1
- antns
- mt
- public void writeTo(String t, Class<?> type, Type type1, Annotation[] antns, javax.ws.rs.core.MediaType mt, javax.ws.rs.core.MultivaluedMap<String,Object> mm, OutputStream out) throws IOException, javax.ws.rs.WebApplicationException
writeTo
in interface javax.ws.rs.ext.MessageBodyWriter<String>
IOException
javax.ws.rs.WebApplicationException
Copyright © 2015. All rights reserved.