de.vc.jfo.importer

## Class Importer

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

- Direct Known Subclasses:
    RTFImporter

      public abstract class Importer
      extends java.lang.Object

  Common interface for an importer that converts an external format into xsl-fo.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Importer()`
    `protected` | `Importer(ImportParameters params)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract Document` | `doImport(java.io.InputStream source, java.lang.String baseDir)`
    `protected java.io.File` | `getImagePath()`
    `ImportParameters` | `getParameters()` Gets the parameters for this importer.
    `abstract java.lang.String` | `getType()` Gets the type of the external document.
    `java.io.File[]` | `getWrittenImages()` Gets an array of all images that were read during import.
    `Document` | `importDocument(java.io.InputStream source)` Import a document.
    `Document` | `importDocument(java.lang.String sourceFile)` Import a document.
    `void` | `setParameters(ImportParameters parameters)` Sets the parameters for this importer.
    `abstract boolean` | `supportsFontMapping()` Determinates if this importer supports font-mapping.
    `java.lang.String` | `writeImageFile(java.io.InputStream picture, boolean skipIfExists, ImageMetaData id)` Stores a picture to disc, used by importer.

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

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

- - ### Constructor Detail

    - #### Importer

          protected Importer()

    - #### Importer

          protected Importer(ImportParameters params)

  - ### Method Detail

    - #### importDocument

          public final Document importDocument(java.lang.String sourceFile)
                                        throws java.io.IOException

      Import a document.
      Parameters:
        `sourceFile` - Source of document.
      Returns:
        FO-document
      Throws:
        `java.io.IOException`

    - #### importDocument

          public final Document importDocument(java.io.InputStream source)
                                        throws java.io.IOException

      Import a document.
      Parameters:
        `source` - Source of document.
      Returns:
        FO-document
      Throws:
        `java.io.IOException`

    - #### getType

          public abstract java.lang.String getType()

      Gets the type of the external document. This should be the file-suffix.
      Returns:
        File type (RTF, HTML ...).

    - #### supportsFontMapping

          public abstract boolean supportsFontMapping()

      Determinates if this importer supports font-mapping.
      Returns:
        true, if supported.

    - #### getParameters

          public ImportParameters getParameters()

      Gets the parameters for this importer.
      Returns:
        Import parameters.

    - #### setParameters

          public void setParameters(ImportParameters parameters)

      Sets the parameters for this importer.
      Parameters:
        `parameters` - Import parameters.

    - #### getWrittenImages

          public java.io.File[] getWrittenImages()

      Gets an array of all images that were read during import.
      Returns:
        Array of files.

    - #### doImport

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

      Throws:
        `java.io.IOException`

    - #### writeImageFile

          public java.lang.String writeImageFile(java.io.InputStream picture,
                                        boolean skipIfExists,
                                        ImageMetaData id)

      Stores a picture to disc, used by importer.
      Parameters:
        `picture` - Picture.
        `skipIfExists` - true forces to skip picture if file already exists.
        `id` - Image descriptor.
      Returns:
        Absolute or relative path to picture.

    - #### getImagePath

          protected java.io.File getImagePath()

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