@Provider @Produces(value="application/xml") public class PrettyPrinter extends Object implements MessageBodyWriter<Object>
Constructor and Description |
---|
PrettyPrinter() |
Modifier and Type | Method and Description |
---|---|
long |
getSize(Object object,
Class<?> type,
Type genericType,
Annotation[] methodAnnotations,
MediaType mediaType) |
boolean |
isWriteable(Class<?> type,
Type genericType,
Annotation[] methodAnnotations,
MediaType mediaType)
Return true for any JAXB class
|
void |
writeTo(Object object,
Class<?> type,
Type genericType,
Annotation[] methodAnnotations,
MediaType mediaType,
MultivaluedMap<String,Object> httpHeaders,
OutputStream os)
Write the provided JAXB object using formatted output.
|
public long getSize(Object object, Class<?> type, Type genericType, Annotation[] methodAnnotations, MediaType mediaType)
getSize
in interface MessageBodyWriter<Object>
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] methodAnnotations, MediaType mediaType)
isWriteable
in interface MessageBodyWriter<Object>
public void writeTo(Object object, Class<?> type, Type genericType, Annotation[] methodAnnotations, MediaType mediaType, MultivaluedMap<String,Object> httpHeaders, OutputStream os) throws IOException, WebApplicationException
writeTo
in interface MessageBodyWriter<Object>
IOException
WebApplicationException
Copyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.