de.smartics.properties.admin.resources.representation.share
Class AbstractRepresentationRenderer<T>

Package class diagram package AbstractRepresentationRenderer
java.lang.Object
  extended by de.smartics.properties.admin.resources.representation.share.AbstractRepresentationRenderer<T>
Type Parameters:
T - the type of the resource the renderer is rendering representations for.
All Implemented Interfaces:
de.smartics.resteasy.hypermedia.renderer.RepresentationRenderer<T>
Direct Known Subclasses:
AbstractHtmlRepresentationRenderer, AbstractXmlRepresentationRenderer

public abstract class AbstractRepresentationRenderer<T>
     
     
extends Object
implements de.smartics.resteasy.hypermedia.renderer.RepresentationRenderer<T>

Base implementation for document renderers.


Field Summary
protected  BreadcrumbHelper breadcrumb
          The helper to create the breadcrumbs.
protected  String characterEncoding
          The character encoding to use to render the output.
protected  OutputStream entityStream
          The original stream to write to.
protected  de.smartics.properties.utils.HtmlUtils htmlUtils
          Utilities to deal with HTML.
protected  LinkDescriptorFactory linkDescriptorFactory
          The factory to create link descriptors.
protected  HtmlPathHelper pathHelper
          Helper to localize application specific resources.
 
Constructor Summary
protected AbstractRepresentationRenderer(de.smartics.resteasy.hypermedia.renderer.ResourceContext context, String characterEncoding, OutputStream entityStream, String method)
          Default constructor using a stream.
 
Method Summary
protected abstract  void close()
          Releases any resources held by the renderer.
protected abstract  void httpBody()
          Redners the HTTP body.
 void render()
           
protected  void renderAdditionalHttpHeader(javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders)
          Hook to override in subclasses to add additional HTTP headers.
protected  void renderHttpHeaderLink(javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, de.smartics.resteasy.hypermedia.renderer.LinkDescriptor link)
          Renders a link in the HTTP header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entityStream

protected final OutputStream entityStream
The original stream to write to.


characterEncoding

protected final String characterEncoding
The character encoding to use to render the output.


pathHelper

protected final HtmlPathHelper pathHelper
Helper to localize application specific resources.


linkDescriptorFactory

protected final LinkDescriptorFactory linkDescriptorFactory
The factory to create link descriptors.


breadcrumb

protected final BreadcrumbHelper breadcrumb
The helper to create the breadcrumbs.


htmlUtils

protected final de.smartics.properties.utils.HtmlUtils htmlUtils
Utilities to deal with HTML.

Constructor Detail

AbstractRepresentationRenderer

protected AbstractRepresentationRenderer(de.smartics.resteasy.hypermedia.renderer.ResourceContext context,
                                         String characterEncoding,
                                         OutputStream entityStream,
                                         String method)
Default constructor using a stream.

Parameters:
context - the context information to render the representation.
characterEncoding - the character encoding to use to render the output.
entityStream - the stream to write to.
method - the method to select the service method of the resource.
Method Detail

render

public void render()
Specified by:
render in interface de.smartics.resteasy.hypermedia.renderer.RepresentationRenderer<T>

renderAdditionalHttpHeader

protected void renderAdditionalHttpHeader(javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders)
Hook to override in subclasses to add additional HTTP headers.

Parameters:
httpHeaders - the headers to add to.

renderHttpHeaderLink

protected final void renderHttpHeaderLink(javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
                                          de.smartics.resteasy.hypermedia.renderer.LinkDescriptor link)
Renders a link in the HTTP header.

Parameters:
httpHeaders - the headers to add to.
link - the link to add.

httpBody

protected abstract void httpBody()
Redners the HTTP body.


close

protected abstract void close()
Releases any resources held by the renderer.



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