de.smartics.resteasy.hypermedia.renderer
Class AbstractRepresentationBodyWriter<T>

Package class diagram package AbstractRepresentationBodyWriter
java.lang.Object
  extended by de.smartics.resteasy.hypermedia.renderer.AbstractRepresentationBodyWriter<T>
Type Parameters:
T - the type of resource whose instances are written to the stream.
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyWriter<T>

public abstract class AbstractRepresentationBodyWriter<T>
     
     
extends Object
implements javax.ws.rs.ext.MessageBodyWriter<T>

Base implementation to pass rendering information to representation renderers.


Constructor Summary
protected AbstractRepresentationBodyWriter()
          Default constructor.
 
Method Summary
protected abstract  RepresentationRenderer<T> create(ResourceContext context, T domainObject, OutputStream entityStream)
          Creates an instance of the representation renderer.
protected abstract  I18nProvider getI18nProvider()
          Returns access to internationalization information.
 long getSize(T t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 void writeTo(T t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.ws.rs.ext.MessageBodyWriter
isWriteable
 

Constructor Detail

AbstractRepresentationBodyWriter

protected AbstractRepresentationBodyWriter()
Default constructor.

Method Detail

getI18nProvider

protected abstract I18nProvider getI18nProvider()
Returns access to internationalization information.

Returns:
access to internationalization information.

getSize

public long getSize(T t,
                    Class<?> type,
                    Type genericType,
                    Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType)
Specified by:
getSize in interface javax.ws.rs.ext.MessageBodyWriter<T>

writeTo

public void writeTo(T t,
                    Class<?> type,
                    Type genericType,
                    Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType,
                    javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
                    OutputStream entityStream)
             throws IOException,
                    javax.ws.rs.WebApplicationException
Specified by:
writeTo in interface javax.ws.rs.ext.MessageBodyWriter<T>
Throws:
IOException
javax.ws.rs.WebApplicationException

create

protected abstract RepresentationRenderer<T> create(ResourceContext context,
                                                    T domainObject,
                                                    OutputStream entityStream)
Creates an instance of the representation renderer.

Parameters:
context - the context information to be passed to the representation renderer.
domainObject - the domain object to render.
entityStream - the stream to write to.
Returns:
the representation renderer instance.


Copyright © 2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.