org.apache.fop.render

Class RendererContext


public class RendererContext
extends java.lang.Object

The Render Context for external handlers. This provides a rendering context so that external handlers can get information to be able to render to the render target.

Nested Class Summary

static class
RendererContext.RendererContextWrapper
Base class for a wrapper around RendererContext to access its properties in a type-safe, renderer-specific way.

Constructor Summary

RendererContext(AbstractRenderer renderer, String m)
Contructor for this class.

Method Summary

String
getMimeType()
Returns the MIME type associated with this RendererContext.
Object
getProperty(String prop)
Returns a property from the RendererContext.
AbstractRenderer
getRenderer()
FOUserAgent
getUserAgent()
Returns the user agent.
void
setProperty(String name, Object val)
Sets a property on the RendererContext.
void
setUserAgent(FOUserAgent ua)
Sets the user agent.
static RendererContext.RendererContextWrapper
wrapRendererContext(RendererContext context)
Wrap the render context to allow easier access to its values.

Constructor Details

RendererContext

public RendererContext(AbstractRenderer renderer,
                       String m)
Contructor for this class. It takes a MIME type as parameter.
Parameters:
renderer - The current renderer
m - The MIME type of the output that's generated.

Method Details

getMimeType

public String getMimeType()
Returns the MIME type associated with this RendererContext.
Returns:
The MIME type (ex. application/pdf)

getProperty

public Object getProperty(String prop)
Returns a property from the RendererContext.
Parameters:
prop - The key of the property to return.
Returns:
The requested value, null if it doesn't exist.

getRenderer

public AbstractRenderer getRenderer()
Returns:
Returns the renderer.

getUserAgent

public FOUserAgent getUserAgent()
Returns the user agent.
Returns:
The user agent

setProperty

public void setProperty(String name,
                        Object val)
Sets a property on the RendererContext.
Parameters:
name - The key of the property
val - The value of the property

setUserAgent

public void setUserAgent(FOUserAgent ua)
Sets the user agent.
Parameters:
ua - The user agent

wrapRendererContext

public static RendererContext.RendererContextWrapper wrapRendererContext(RendererContext context)
Wrap the render context to allow easier access to its values.
Parameters:
context - the renderer context
Returns:
the generic renderer context wrapper

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.