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<java.util.List<Message>>

@Provider
public class MessageListWriter
extends java.lang.Object
implements MessageBodyWriter<java.util.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(java.util.List<Message> messages, java.lang.Class<?> clazz, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotation, MediaType mediaType)
           
 boolean isWriteable(java.lang.Class<?> clazz, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotation, MediaType mediaType)
           
 void writeTo(java.util.List<Message> messages, java.lang.Class<?> clazz, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotation, MediaType mediaType, MultivaluedMap<java.lang.String,java.lang.Object> arg5, java.io.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(java.lang.Class<?> clazz,
                           java.lang.reflect.Type type,
                           java.lang.annotation.Annotation[] annotation,
                           MediaType mediaType)
Specified by:
isWriteable in interface MessageBodyWriter<java.util.List<Message>>

getSize

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

writeTo

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


Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.