de.vc.jfo.renderer

## Class FOP0205Renderer

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

- All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Comparable
  Direct Known Subclasses:
    FOPRenderer

      public class FOP0205Renderer
      extends Renderer

  Renderer that use Apache FOP to transform XSL-FO documents. For more information about FOP visit http://xml.apache.org/fop/index.html
  Currently supported output formats: PDF, PDF_FORM, PS, PCL, SVG, TXT, XML, PRINT.
  See Also:
    http://xml.apache.org/fop/index.html, `OutputFormat.PDF`, `OutputFormat.PCL`, `OutputFormat.PS`, `OutputFormat.PDF`, `OutputFormat.SVG`, `OutputFormat.PRINT`, `OutputFormat.XML_TREE_FOP`, `OutputFormat.PDF_FORM`, `OutputFormat.PDF_FORM`

- - ### 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
    `FOP0205Renderer()` Creates a new XSL-FO render that uses Apache's FOP.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `afterRendering()` Invoked after rendering.
    `protected void` | `beforeRendering()` Invoked before rendering starts.
    `void` | `configure(de.vc.config.Configuration config)` Configures this renderer.
    `protected org.apache.fop.render.Renderer` | `createAWTRenderer()`
    `protected void` | `doRender(Document doc, java.io.OutputStream out, OutputFormat outputFormat)` Override super methodes because we're firing SAX events directly to FOPs content handler.
    `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).
    `static org.apache.avalon.framework.logger.Logger` | `getDefaultLogger()` Gets the default logger for FOP-renderers.
    `java.lang.String` | `getDisplayName()` Gets the display name of renderer that can be shown in GUIs.
    `org.apache.avalon.framework.logger.Logger` | `getLogger()`
    `RTF2FOCompatibilityMode` | `getPreferredRTF2FOCompatibilityMode()` FOP_0_20_5 is returned.
    `OutputFormat[]` | `getSupportedOutputFormats()` Gets an array of all supported output formats.
    `boolean` | `isReady()` Checks if this renderer has all needed resources (external classes, configuration files etc) to renderer a document.
    `static void` | `resetImageCache()` Resets the image cache of FOPs image factory.
    `static void` | `setDefaultLogger(org.apache.avalon.framework.logger.Logger logger)` Sets the default logger for FOP-renderers.
    `void` | `setLogger(org.apache.avalon.framework.logger.Logger logger)` Sets the logger for Apache FOP.

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

      `canRender, compareTo, copy, createPrinterJob, equals, getConfigFile, getPrinterJobFactory, getPriority, 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

    - #### FOP0205Renderer

          public FOP0205Renderer()

      Creates a new XSL-FO render that uses Apache's FOP.

  - ### Method Detail

    - #### setDefaultLogger

          public static void setDefaultLogger(org.apache.avalon.framework.logger.Logger logger)

      Sets the default logger for FOP-renderers. Initially the logger of JFO is used as default logger.
      Parameters:
        `logger` - Logger.

    - #### getDefaultLogger

          public static org.apache.avalon.framework.logger.Logger getDefaultLogger()

      Gets the default logger for FOP-renderers.
      Returns:
        Default FOP logger.

    - #### getPreferredRTF2FOCompatibilityMode

          public RTF2FOCompatibilityMode getPreferredRTF2FOCompatibilityMode()

      FOP_0_20_5 is returned.
      Overrides:
        `getPreferredRTF2FOCompatibilityMode` in class `Renderer`
      Returns:
        RTF2FOCompatibilityMode.FOP_0_20_5

    - #### setLogger

          public void setLogger(org.apache.avalon.framework.logger.Logger logger)

      Sets the logger for Apache FOP. Initially this is the default logger that is hold static by this FOPRenderer class.
      Parameters:
        `logger` - Logger.

    - #### getLogger

          public org.apache.avalon.framework.logger.Logger getLogger()

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

    - #### getSupportedOutputFormats

          public OutputFormat[] getSupportedOutputFormats()

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

    - #### resetImageCache

          public static void resetImageCache()

      Resets the image cache of FOPs image factory. Simply calls `org.apache.fop.image.FopImageFactory.resetCache()`

    - #### configure

          public void configure(de.vc.config.Configuration config)
                         throws de.vc.config.ConfigurationException

      Description copied from class: `Renderer`
      Configures this renderer. This method does only configure this adapter to the external renderer but not the external renderer. The external renderer is configured when the renderer method is invoked (lazy initialization).
      Overrides:
        `configure` in class `Renderer`
      Parameters:
        `config` - Configuration
      Throws:
        `de.vc.config.ConfigurationException`

    - #### isReady

          public boolean isReady()

      Description copied from class: `Renderer`
      Checks if this renderer has all needed resources (external classes, configuration files etc) to renderer a document.
      Overrides:
        `isReady` in class `Renderer`
      Returns:
        boolean

    - #### createAWTRenderer

          protected org.apache.fop.render.Renderer createAWTRenderer()

    - #### doRender

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

      Override super methodes because we're firing SAX events directly to FOPs content handler. So we don't have to store document into a file before.
      Overrides:
        `doRender` in class `Renderer`
      Parameters:
        `doc` - Document.
        `out` - Output.
        `outputFormat` - Output format.
      Throws:
        `java.lang.Exception`

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

    - #### afterRendering

          protected void afterRendering()
                                 throws java.lang.Exception

      Invoked after rendering.
      Overrides:
        `afterRendering` in class `Renderer`
      Throws:
        `java.lang.Exception`

    - #### beforeRendering

          protected void beforeRendering()
                                  throws java.lang.Exception

      Description copied from class: `Renderer`
      Invoked before rendering starts.
      Overrides:
        `beforeRendering` in class `Renderer`
      Throws:
        `java.lang.Exception`

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