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:
javax.ws.rs.ext.MessageBodyWriter<List<Message>>

@Provider
public class MessageListWriter
extends Object
implements javax.ws.rs.ext.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, javax.ws.rs.core.MediaType mediaType)
           
 boolean isWriteable(Class<?> clazz, Type type, Annotation[] annotation, javax.ws.rs.core.MediaType mediaType)
           
 void writeTo(List<Message> messages, Class<?> clazz, Type type, Annotation[] annotation, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.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,
                           javax.ws.rs.core.MediaType mediaType)
Specified by:
isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<List<Message>>

getSize

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

writeTo

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


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