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

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

@Provider
public class MessageListWriter
extends Object
implements MessageBodyWriter<List<Message>>

A simple HTML message body writer to serialize list of message beans.

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

Constructor Summary
MessageListWriter()
           
 
Method Summary
 long getSize(List<Message> messages, Class<?> clazz, Type type, Annotation[] annotation, MediaType mediaType)
           
 boolean isWriteable(Class<?> clazz, Type type, Annotation[] annotation, MediaType mediaType)
           
 void writeTo(List<Message> messages, 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

MessageListWriter

public MessageListWriter()
Method Detail

isWriteable

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

getSize

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

writeTo

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


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