org.glassfish.jersey.examples.jersey_ejb.entities
Class MessageWriter

java.lang.Object
  extended by org.glassfish.jersey.examples.jersey_ejb.entities.MessageWriter
All Implemented Interfaces:
MessageBodyWriter<Message>

@Provider
public class MessageWriter
extends Object
implements MessageBodyWriter<Message>

A simple message body writer to serialize a single message bean.

Author:
Pavel Bucek (pavel.bucek at oracle.com)

Constructor Summary
MessageWriter()
           
 
Method Summary
 long getSize(Message message, Class<?> clazz, Type type, Annotation[] annotation, MediaType mediaType)
           
 boolean isWriteable(Class<?> clazz, Type type, Annotation[] annotation, MediaType mediaType)
           
 void writeTo(Message message, Class<?> clazz, Type type, Annotation[] annotation, MediaType mediaType, MultivaluedMap<String,Object> arg5, OutputStream ostream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageWriter

public MessageWriter()
Method Detail

isWriteable

public boolean isWriteable(Class<?> clazz,
                           Type type,
                           Annotation[] annotation,
                           MediaType mediaType)
Specified by:
isWriteable in interface MessageBodyWriter<Message>

getSize

public long getSize(Message message,
                    Class<?> clazz,
                    Type type,
                    Annotation[] annotation,
                    MediaType mediaType)
Specified by:
getSize in interface MessageBodyWriter<Message>

writeTo

public void writeTo(Message message,
                    Class<?> clazz,
                    Type type,
                    Annotation[] annotation,
                    MediaType mediaType,
                    MultivaluedMap<String,Object> arg5,
                    OutputStream ostream)
             throws IOException,
                    WebApplicationException
Specified by:
writeTo in interface MessageBodyWriter<Message>
Throws:
IOException
WebApplicationException


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.