de.uplanet.lucy.server.renderer
Interface IRenderer


public interface IRenderer

The common interface of all renderers.

Note that this interface does not enforce type-safety through generic type parameters. This reflects it's main usage in the web context as well as Java type erasure.

So renderers are required to check types at runtime and to throw adequate exceptions.

Default rendering parameters (setParam)

Version:
$Revision: 64410 $

Nested Class Summary
static class IRenderer.ErrorMode
           
 
Field Summary
static java.lang.String PARAM_DEFAULT_OUTPUT
          The de.uplanet.lucy.server.renderer.IRenderer.defaultOutput property specifies the output that's generated by the renderer if no input data are provided.
static java.lang.String PARAM_ERROR_MODE
          Error mode, valid values: value of enum class IRenderer.ErrorMode
(default: exceptionThrow)
exceptionThrow, throw a RendererException iif an error occurs errorMsg, returns the error value, given by the de.uplanet.lucy.server.renderer.IRenderer.errorMsg parameter, when the input value is not castable or not parseable.
static java.lang.String PARAM_ERROR_MSG
          de.uplanet.lucy.server.renderer.IRenderer.errorMsg default: "" Text will return iif PARAM_ERRORMODE == errorMsg and an error occurred.
static java.lang.String PARAM_HTML_BR_INSERT
          de.uplanet.lucy.server.renderer.IRenderer.htmlBRInsert
static java.lang.String PARAM_HTML_ENCODE
          de.uplanet.lucy.server.renderer.IRenderer.htmlEncode
static java.lang.String PARAM_JAVASCRIPT_ENCODE
          de.uplanet.lucy.server.renderer.IRenderer.javaScriptEncode
 
Method Summary
 java.lang.String getOutput(IValueHolder<?> p_vh)
          Get the rendered results as a string.
 void setParam(java.lang.String p_strName, java.lang.Object p_value)
          Set a renderer parameter.
 void writeOutput(de.uplanet.lucy.server.renderer.IPipedRenderer p_child, IValueHolder<?> p_vh)
          Write the rendered results to the given child renderer.
 void writeOutput(java.io.Writer p_out, IValueHolder<?> p_vh)
          Write the rendered results to the given output stream.
 

Field Detail

PARAM_DEFAULT_OUTPUT

static final java.lang.String PARAM_DEFAULT_OUTPUT
The de.uplanet.lucy.server.renderer.IRenderer.defaultOutput property specifies the output that's generated by the renderer if no input data are provided.

The default value for this property is the empty string.


PARAM_ERROR_MODE

static final java.lang.String PARAM_ERROR_MODE
Error mode, valid values: value of enum class IRenderer.ErrorMode
(default: exceptionThrow)


PARAM_ERROR_MSG

static final java.lang.String PARAM_ERROR_MSG
de.uplanet.lucy.server.renderer.IRenderer.errorMsg

default: ""

Text will return iif PARAM_ERRORMODE == errorMsg and an error occurred.


PARAM_JAVASCRIPT_ENCODE

static final java.lang.String PARAM_JAVASCRIPT_ENCODE
de.uplanet.lucy.server.renderer.IRenderer.javaScriptEncode


PARAM_HTML_ENCODE

static final java.lang.String PARAM_HTML_ENCODE
de.uplanet.lucy.server.renderer.IRenderer.htmlEncode


PARAM_HTML_BR_INSERT

static final java.lang.String PARAM_HTML_BR_INSERT
de.uplanet.lucy.server.renderer.IRenderer.htmlBRInsert

Method Detail

writeOutput

void writeOutput(java.io.Writer p_out,
                 IValueHolder<?> p_vh)
                 throws de.uplanet.lucy.server.renderer.RendererException,
                        java.io.IOException
Write the rendered results to the given output stream.

If the given value holder provides a Closeable data object, the renderer will call the close() method if it uses it.

Parameters:
p_out - The output stream.
p_vh - The value to be rendered.
Throws:
de.uplanet.lucy.server.renderer.RendererException - - If an error occurred. This exception may wrap other exceptions that occurred while rendering the input.
java.io.IOException - - If an I/O error occurred.

writeOutput

void writeOutput(de.uplanet.lucy.server.renderer.IPipedRenderer p_child,
                 IValueHolder<?> p_vh)
                 throws de.uplanet.lucy.server.renderer.RendererException,
                        java.io.IOException
Write the rendered results to the given child renderer.

If the given value holder provides a Closeable data object, the renderer will call the close() method if it uses it.

Parameters:
p_child - The child renderer.
p_vh - The value to be rendered.
Throws:
de.uplanet.lucy.server.renderer.RendererException - - If an error occurred. This exception may wrap other exceptions that occurred while rendering the input.
java.io.IOException - - If an I/O error occurred.

getOutput

java.lang.String getOutput(IValueHolder<?> p_vh)
                           throws de.uplanet.lucy.server.renderer.RendererException
Get the rendered results as a string.

If the given value holder provides a Closeable data object, the renderer will call the close() method if it uses it.

Parameters:
p_vh - The value to be rendered.
Returns:
The rendered value.
Throws:
de.uplanet.lucy.server.renderer.RendererException - - If an error occurred. This exception may wrap other exceptions that occurred while rendering the input.

setParam

void setParam(java.lang.String p_strName,
              java.lang.Object p_value)
              throws de.uplanet.lucy.server.renderer.RendererException
Set a renderer parameter.

Parameters:
p_strName - The name of the parameter.
p_value - The value of the parameter.
Throws:
de.uplanet.lucy.server.renderer.RendererException


Last updated: 2011-01-27
Copyright 2000-2010 United Planet. All Rights Reserved.