org.apache.fop.render

## Class RendererContext

- java.lang.Object
- - org.apache.fop.render.RendererContext

- Direct Known Subclasses:
    AFPRendererContext

      public class RendererContext
      extends 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

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `RendererContext.RendererContextWrapper` Base class for a wrapper around RendererContext to access its properties in a type-safe, renderer-specific way.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RendererContext(AbstractRenderer renderer, String mime)` Constructor for this class.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.
    `String` | `toString()`
    `static RendererContext.RendererContextWrapper` | `wrapRendererContext(RendererContext context)` Wrap the render context to allow easier access to its values.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### RendererContext

          public RendererContext(AbstractRenderer renderer,
                                 String mime)

      Constructor for this class. It takes a MIME type as parameter.
      Parameters:
        `renderer` - the current renderer
        `mime` - the MIME type of the output that's generated.

  - ### Method Detail

    - #### getRenderer

          public AbstractRenderer getRenderer()

      Returns:
        Returns the renderer.

    - #### getMimeType

          public String getMimeType()

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

    - #### setUserAgent

          public void setUserAgent(FOUserAgent ua)

      Sets the user agent.
      Parameters:
        `ua` - The user agent

    - #### 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

    - #### 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.

    - #### 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

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2023 Apache Software Foundation. All rights reserved.