de.vc.jfo.renderer

## Class CompositeRenderer

- java.lang.Object
- - de.vc.jfo.renderer.Renderer
  - - de.vc.jfo.renderer.CompositeRenderer

- All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Comparable

      public class CompositeRenderer
      extends Renderer

  A composite renderer joins a set of renderers. When a document is rendered the concret renderer is chosen by the output format and renderer priority. Use the composite renderer to combine concrete renderers with different output formats (e.g. join a PDF and Postscript renderer).

- - ### Field Summary

    - ### Fields inherited from class de.vc.jfo.renderer.Renderer

      `DEFAULT_PRIORITY, XML_ATTR_CLASS, XML_ATTR_CONFIG_EDITOR, XML_ATTR_CONFIG_FILE, XML_ATTR_NAME, XML_ATTR_PRIORTIY, XML_ATTR_RESET_IMAGE_CACHE, XML_ATTR_USE_JFO_LOGGING, XML_NODE_RENDERER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompositeRenderer()` Creates a distributed renderer.
    `CompositeRenderer(Renderer[] renderers)` Creates a distributed renderer and registers some renderers to its list.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `doRender(Document doc, java.io.OutputStream outStream, OutputFormat outputFormat)` Renders the given document using this renderer.
    `protected void` | `doRender(java.io.InputStream foStream, java.io.OutputStream outStream, OutputFormat outputFormat)` Do render a FO-stream (Stream is in XML, not in XSL).
    `protected Renderer` | `findRenderer(OutputFormat outputFormat)`
    `java.lang.String` | `getDisplayName()` Gets the display name of renderer that can be shown in GUIs.
    `java.util.List` | `getRegisteredRenderers()` Returns an unmodifiable list of registered renderers.
    `OutputFormat[]` | `getSupportedOutputFormats()` Gets an array of all supported output formats.
    `protected void` | `register(java.util.Collection renderers)` Registers renderers.
    `void` | `register(Renderer renderer)` Registers renderer.
    `void` | `register(Renderer[] renderers)` Registers renderers.

    - ### Methods inherited from class de.vc.jfo.renderer.Renderer

      `afterRendering, beforeRendering, canRender, compareTo, configure, copy, createPrinterJob, equals, getConfigFile, getPreferredRTF2FOCompatibilityMode, getPrinterJobFactory, getPriority, isReady, isUseJFOLogging, logUnsupportedFormat, reconfigure, render, render, render, render, resolveConfig, setConfigFile, setPrinterJobFactory, setPriority, setUseJFOLogging, supportsFormat`

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

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

- - ### Constructor Detail

    - #### CompositeRenderer

          public CompositeRenderer()

      Creates a distributed renderer.

    - #### CompositeRenderer

          public CompositeRenderer(Renderer[] renderers)

      Creates a distributed renderer and registers some renderers to its list.
      Parameters:
        `renderers` - Renderers.

  - ### Method Detail

    - #### register

          public void register(Renderer[] renderers)

      Registers renderers.
      Parameters:
        `renderers` - Renderers.

    - #### register

          public void register(Renderer renderer)

      Registers renderer.
      Parameters:
        `renderer` - Renderer.

    - #### doRender

          protected void doRender(java.io.InputStream foStream,
                      java.io.OutputStream outStream,
                      OutputFormat outputFormat)
                           throws java.lang.Exception

      Description copied from class: `Renderer`
      Do render a FO-stream (Stream is in XML, not in XSL). You don't have to close the output-stream.
      Specified by:
        `doRender` in class `Renderer`
      Parameters:
        `foStream` - FO-stream.
        `outStream` - Output stream, where rendered FO should be stored into.
        `outputFormat` - Outputformat (see OUTPUT_*).
      Throws:
        `java.lang.Exception` - Throw an exception in necessary.

    - #### doRender

          protected void doRender(Document doc,
                      java.io.OutputStream outStream,
                      OutputFormat outputFormat)
                           throws java.lang.Exception

      Description copied from class: `Renderer`
      Renders the given document using this renderer. You don't have to close the output-stream.
      Overrides:
        `doRender` in class `Renderer`
      Parameters:
        `doc` - Document.
        `outStream` - Output.
        `outputFormat` - Output format.
      Throws:
        `java.lang.Exception` - This renderer may throw an exception.

    - #### getSupportedOutputFormats

          public OutputFormat[] getSupportedOutputFormats()

      Gets an array of all supported output formats. This array is build using all supported output formats of registered renderers.
      Specified by:
        `getSupportedOutputFormats` in class `Renderer`
      Returns:
        Array of output formats (see OUTPUT_*).

    - #### getDisplayName

          public java.lang.String getDisplayName()

      Description copied from class: `Renderer`
      Gets the display name of renderer that can be shown in GUIs.
      Specified by:
        `getDisplayName` in class `Renderer`
      Returns:
        Display name.

    - #### getRegisteredRenderers

          public java.util.List getRegisteredRenderers()

      Returns an unmodifiable list of registered renderers.
      Returns:
        List of registered renderers.

    - #### findRenderer

          protected Renderer findRenderer(OutputFormat outputFormat)

    - #### register

          protected void register(java.util.Collection renderers)

      Registers renderers.
      Parameters:
        `renderers` - Renderers.

© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.