org.apache.myfaces.custom.dynamicResources
Interface ResourceRenderer

All Known Subinterfaces:
ImageRenderer, ImageRenderer

public interface ResourceRenderer

The ImageRenderer is used to render the binary data for a html img tag Implementions must have a default constructor

Version:
$Revision: 673833 $ $Date: 2008-07-03 16:58:05 -0500 (Thu, 03 Jul 2008) $
Author:
Mathias Broekelmann

Method Summary
 int getContentLength()
          The content length of the image to render.
 java.lang.String getContentType()
          The MimeType of the image.
 void renderResource(javax.faces.context.ResponseStream out)
          Called to render the image to the given outputstream.
 void setContext(javax.faces.context.FacesContext facesContext, ResourceContext resourceContext)
          This method will be called first, to set the contexts.
 

Method Detail

setContext

void setContext(javax.faces.context.FacesContext facesContext,
                ResourceContext resourceContext)
                throws java.lang.Exception
This method will be called first, to set the contexts.

Parameters:
facesContext - the faces context
imageContext - the image context width aditional image parameters
Throws:
java.lang.Exception

getContentLength

int getContentLength()
The content length of the image to render. Set to a negative value if you don't want to set the response content length.

Returns:
the content length of the rendered image

getContentType

java.lang.String getContentType()
The MimeType of the image. This is usally a value of image/jpeg, image/gif, image/png or anything else which can be used as an image for html

Returns:
the Mime-Type, not null

renderResource

void renderResource(javax.faces.context.ResponseStream out)
                    throws java.io.IOException
Called to render the image to the given outputstream.

Parameters:
out - the outputstream which is used to write the binary data of the image
Throws:
java.io.IOException


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.