de.vc.jfo.rtf

## Class RTFImporter

- java.lang.Object
- - de.vc.jfo.importer.Importer
  - - de.vc.jfo.rtf.RTFImporter

-     public class RTFImporter
      extends Importer

  This importer can read RTF files and stream and converts them to an XSL-FO DOM tree.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RTFImporter()` Creates a new RTF importer.
    `RTFImporter(ImportParameters params)` Creates a new RTF importer with Import-Parameters.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addFieldListener(FieldListener listener)` Adds a field listener that is notified when a field was encountered by this importer.
    `void` | `addImportListener(ImportListener listener)` Adds an import listener that is notified on some import events.
    `protected Document` | `doImport(java.io.InputStream is, java.lang.String baseDir)` Imports a RTF document to XSL-FO.
    `RTF2FOConfig` | `getConfiguration()` Gets the configuration of this importer.
    `protected java.io.File` | `getImagePath()`
    `java.lang.String` | `getType()` Returns always "rtf".
    `FieldListener[]` | `listFieldListeners()` Lists all field listeners.
    `void` | `removeAllFieldListeners()` Removes all field listeners.
    `void` | `removeAllImportListeners()` Removes all import listeners.
    `void` | `removeFieldListener(FieldListener listener)` Removes a field listener.
    `void` | `removeImportListener(ImportListener listener)` Removes an import listener.
    `void` | `setConfiguration(RTF2FOConfig configuration)` Overrides the global configuration.
    `boolean` | `supportsFontMapping()` Returns always true.
    `void` | `unregisterAllFieldProcessors()` Deprecated. Use removeAllFieldListeners() instead.

    - ### Methods inherited from class de.vc.jfo.importer.Importer

      `getParameters, getWrittenImages, importDocument, importDocument, setParameters, writeImageFile`

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

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

- - ### Constructor Detail

    - #### RTFImporter

          public RTFImporter()

      Creates a new RTF importer. The current RTF2FO configuration is cloned and attached to this converter.

    - #### RTFImporter

          public RTFImporter(ImportParameters params)

      Creates a new RTF importer with Import-Parameters. The current RTF2FO configuration is cloned and attached to this converter.
      Parameters:
        `params` - Import Parameters

  - ### Method Detail

    - #### supportsFontMapping

          public final boolean supportsFontMapping()

      Returns always true.
      Specified by:
        `supportsFontMapping` in class `Importer`
      Returns:
        `true`.

    - #### getType

          public final java.lang.String getType()

      Returns always "rtf".
      Specified by:
        `getType` in class `Importer`
      Returns:
        `rtf`.

    - #### getConfiguration

          public RTF2FOConfig getConfiguration()

      Gets the configuration of this importer. When this importer was created, the global configuration was cloned and attached to this importer.
      Returns:
        Configuration.
      See Also:
        `JFOConfig.instance()`

    - #### setConfiguration

          public final void setConfiguration(RTF2FOConfig configuration)

      Overrides the global configuration. This is only neccessary if you need a different configuration than the default configuration of the JFO (as stored in jfo-config.xml).
      Parameters:
        `configuration` - Configuration.
      See Also:
        `JFOConfig.getRTF2FOConfig()`, `RTF2FOConfig.copy()`

    - #### doImport

          protected Document doImport(java.io.InputStream is,
                          java.lang.String baseDir)
                               throws java.io.IOException

      Imports a RTF document to XSL-FO.
      Specified by:
        `doImport` in class `Importer`
      Parameters:
        `is` - Input stream of RTF document.
        `baseDir` - Base dir of input file or null if unknown.
      Returns:
        XSL-FO document.
      Throws:
        `java.io.IOException`

    - #### addFieldListener

          public void addFieldListener(FieldListener listener)

      Adds a field listener that is notified when a field was encountered by this importer.
      Parameters:
        `listener` - FieldListener.

    - #### removeFieldListener

          public void removeFieldListener(FieldListener listener)

      Removes a field listener.
      Parameters:
        `listener` - FieldListener.

    - #### removeAllFieldListeners

          public void removeAllFieldListeners()

      Removes all field listeners.

    - #### listFieldListeners

          public FieldListener[] listFieldListeners()

      Lists all field listeners.
      Returns:
        FieldListener[]

    - #### addImportListener

          public void addImportListener(ImportListener listener)

      Adds an import listener that is notified on some import events.
      Parameters:
        `listener` - Listener.

    - #### removeImportListener

          public void removeImportListener(ImportListener listener)

      Removes an import listener.
      Parameters:
        `listener` - RTFImportListener

    - #### removeAllImportListeners

          public void removeAllImportListeners()

      Removes all import listeners.

    - #### unregisterAllFieldProcessors

          public void unregisterAllFieldProcessors()

      Deprecated. Use removeAllFieldListeners() instead.
      Unregisters all FieldProcessor.

    - #### getImagePath

          protected java.io.File getImagePath()

      Overrides:
        `getImagePath` in class `Importer`

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