oracle.adf.view.rich.export

## Class FormatHandler

- java.lang.Object
- - oracle.adf.view.rich.export.FormatHandler

- All Implemented Interfaces:
    Cloneable

      public abstract class FormatHandler
      extends Object
      implements Cloneable

  FormatHandler handles the format specific information when export is processed.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FormatHandler()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `beginWrapDetailItem(ExportContext exportContext, Object label)` Overridable hook for format handler when we start exporting a component which is inside detail stamp.
    `FormatHandler` | `clone()` Gets a copy of the FormatHandler that can handle exporting to the same format as this one does.
    `protected Object` | `createExportTarget(ExportContext exportContext)` Overridable hook for format handler to create export target.
    `abstract void` | `endDataElement(ExportContext exportContext)` End a data element.
    `abstract void` | `endDetailStamp(ExportContext exportContext)` End a detail stamp element.
    `abstract void` | `endRowElement(ExportContext exportContext)` End a row element.
    `abstract void` | `endTableElement(ExportContext exportContext)` End a table element.
    `abstract void` | `endTableHeaderElement(ExportContext exportContext)` End a table header element.
    `abstract void` | `endWrapDetailItem(ExportContext exportContext)` Overridable hook for format handler when we end exporting a component which is inside detail stamp.
    `abstract String` | `getContentType(ExportContext exportContext)` Retrieves the content type of the content this format handler generates.
    `FormattingState` | `getCurrentFormattingState()` If a specific implementation require to maintain the formatting state/context ,the user of specific FormatHandler can get current FormattingState context.
    `String` | `getDefaultCharset()` Gets the default charset of this export format.
    `abstract String` | `getFormatType()` Retrieves the export type that this format handler handles.
    `int` | `getMaximumRecords(ExportContext exportContext)` Get the maximum number of rows supported by this format handler.
    `boolean` | `isFormattingInfoRequired()` Checks if the exported content supports formatting.
    `abstract void` | `postContent(ExportContext exportContext)` Overridable hook for each format handler to wrap anything after we end exporting the content.
    `abstract void` | `preContent(ExportContext exportContext)` Overridable hook for each format handler to inject anything before we start exporting the content of the component.
    `abstract Object` | `setupExportTarget(ExportContext exportContext)` Sets up the target where the format handler dump the exported content to.
    `abstract void` | `startDataElement(ExportContext exportContext)` Start a data element.
    `abstract void` | `startDetailStamp(ExportContext exportContext)` Start a detail stamp element.
    `abstract void` | `startRowElement(ExportContext exportContext)` Start a row element.
    `abstract void` | `startTableElement(ExportContext exportContext)` Start a table element.
    `abstract void` | `startTableHeaderElement(ExportContext exportContext)` Start a table header element.
    `void` | `writeAttribute(ExportContext exportContext, String name, String value)` Write an attribute on the current element.
    `abstract void` | `writeColSpan(ExportContext exportContext, int colspan)` Handles column span attribute if it is supported.
    `void` | `writeFormattingInfo(ExportContext exportContext)` Overridable hook for each format handler to inject formatting info to the header.
    `abstract void` | `writeRowSpan(ExportContext exportContext, int rowspan)` Handles row span attribute if it is supoorted.
    `abstract void` | `writeText(ExportContext exportContext, Object text, String property)` Writes text to the export target.

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

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

- - ### Constructor Detail

    - #### FormatHandler

          public FormatHandler()

  - ### Method Detail

    - #### getFormatType

          public abstract String getFormatType()

      Retrieves the export type that this format handler handles.
      Returns:
        the export type that this format handler handles.

    - #### getContentType

          public abstract String getContentType(ExportContext exportContext)

      Retrieves the content type of the content this format handler generates.
      Parameters:
        `exportContext` - the export context.
      Returns:
        the content type of the content this format handler generates.

    - #### clone

          public FormatHandler clone()

      Gets a copy of the FormatHandler that can handle exporting to the same format as this one does. The default implementation is to return this. If any FormatHandler that has internal state and cannot be shared, it needs to implement this method to return a true copy of the handler.
      Overrides:
        `clone` in class `Object`
      Returns:
        a copy of the FormatHandler that can handle exporting to the same format as this one does.

    - #### getDefaultCharset

          public String getDefaultCharset()

      Gets the default charset of this export format. The default charset is utf-8.
      Returns:
        the default charset.

    - #### setupExportTarget

          public abstract Object setupExportTarget(ExportContext exportContext)
                                            throws IOException

      Sets up the target where the format handler dump the exported content to. Each diferent format handler will need different target: Writer or OutputStream or other target that is suitable for the export format supported.
      Parameters:
        `exportContext` - the export context.
      Returns:
        an object
      Throws:
        `IOException` - If an I/O error occurs

    - #### preContent

          public abstract void preContent(ExportContext exportContext)
                                   throws IOException

      Overridable hook for each format handler to inject anything before we start exporting the content of the component.
      Parameters:
        `exportContext` - the export context.
      Throws:
        `IOException` - If an I/O error occurs

    - #### postContent

          public abstract void postContent(ExportContext exportContext)
                                    throws IOException

      Overridable hook for each format handler to wrap anything after we end exporting the content.
      Parameters:
        `exportContext` - the export context.
      Throws:
        `IOException` - If an I/O error occurs

    - #### startTableElement

          public abstract void startTableElement(ExportContext exportContext)
                                          throws IOException

      Start a table element.
      Parameters:
        `exportContext` - the export context.
      Throws:
        `IOException` - If an I/O error occurs

    - #### endTableElement

          public abstract void endTableElement(ExportContext exportContext)
                                        throws IOException

      End a table element.
      Parameters:
        `exportContext` - the export context.
      Throws:
        `IOException` - If an I/O error occurs

    - #### startRowElement

          public abstract void startRowElement(ExportContext exportContext)
                                        throws IOException

      Start a row element.
      Parameters:
        `exportContext` - the export context.
      Throws:
        `IOException` - If an I/O error occurs

    - #### endRowElement

          public abstract void endRowElement(ExportContext exportContext)
                                      throws IOException

      End a row element.
      Parameters:
        `exportContext` - the export context.
      Throws:
        `IOException` - If an I/O error occurs

    - #### startTableHeaderElement

          public abstract void startTableHeaderElement(ExportContext exportContext)
                                                throws IOException

      Start a table header element.
      Parameters:
        `exportContext` - the export context.
      Throws:
        `IOException` - If an I/O error occurs

    - #### endTableHeaderElement

          public abstract void endTableHeaderElement(ExportContext exportContext)
                                              throws IOException

      End a table header element.
      Parameters:
        `exportContext` - the export context.
      Throws:
        `IOException` - If an I/O error occurs

    - #### startDataElement

          public abstract void startDataElement(ExportContext exportContext)
                                         throws IOException

      Start a data element. This is the cell if we are exporting table/tree/treeTable.
      Parameters:
        `exportContext` - the export context.
      Throws:
        `IOException` - If an I/O error occurs

    - #### endDataElement

          public abstract void endDataElement(ExportContext exportContext)
                                       throws IOException

      End a data element.
      Parameters:
        `exportContext` - the export context.
      Throws:
        `IOException` - If an I/O error occurs

    - #### startDetailStamp

          public abstract void startDetailStamp(ExportContext exportContext)
                                         throws IOException

      Start a detail stamp element. Any special handling can be done for each handler before exporting a detail stamp component.
      Parameters:
        `exportContext` - the export context.
      Throws:
        `IOException` - If an I/O error occurs

    - #### endDetailStamp

          public abstract void endDetailStamp(ExportContext exportContext)
                                       throws IOException

      End a detail stamp element. Any wrap-up handling can be done for each handler after exporting a detail stamp component.
      Parameters:
        `exportContext` - the export context.
      Throws:
        `IOException` - If an I/O error occurs

    - #### writeColSpan

          public abstract void writeColSpan(ExportContext exportContext,
                                            int colspan)
                                     throws IOException

      Handles column span attribute if it is supported.
      Parameters:
        `exportContext` - the export context.
        `colspan` - the index of the colspan
      Throws:
        `IOException` - If an I/O error occurs

    - #### writeRowSpan

          public abstract void writeRowSpan(ExportContext exportContext,
                                            int rowspan)
                                     throws IOException

      Handles row span attribute if it is supoorted.
      Parameters:
        `exportContext` - the export context.
        `rowspan` - the inde of the row span
      Throws:
        `IOException` - If an I/O error occurs

    - #### writeText

          public abstract void writeText(ExportContext exportContext,
                                         Object text,
                                         String property)
                                  throws IOException

      Writes text to the export target.
      Parameters:
        `exportContext` - the export context.
        `text` - Text to be written
        `property` - Name of the property of attribute (if any) of the component to be associated with
      Throws:
        `IOException` - If an I/O error occurs

    - #### beginWrapDetailItem

          public abstract void beginWrapDetailItem(ExportContext exportContext,
                                                   Object label)
                                            throws IOException

      Overridable hook for format handler when we start exporting a component which is inside detail stamp.
      Parameters:
        `exportContext` - the export context.
        `label` - the label object.
      Throws:
        `IOException` - If an I/O error occurs

    - #### endWrapDetailItem

          public abstract void endWrapDetailItem(ExportContext exportContext)
                                          throws IOException

      Overridable hook for format handler when we end exporting a component which is inside detail stamp.
      Parameters:
        `exportContext` - the export context.
      Throws:
        `IOException` - If an I/O error occurs

    - #### getMaximumRecords

          public int getMaximumRecords(ExportContext exportContext)

      Get the maximum number of rows supported by this format handler. -1 means no limit.
      Parameters:
        `exportContext` - the export context.
      Returns:
        maximum number of rows supported by this format handler.

    - #### isFormattingInfoRequired

          public boolean isFormattingInfoRequired()

      Checks if the exported content supports formatting.
      Returns:
        boolean.

    - #### writeFormattingInfo

          public void writeFormattingInfo(ExportContext exportContext)
                                   throws IOException

      Overridable hook for each format handler to inject formatting info to the header.
      Parameters:
        `exportContext` - the export context.
      Throws:
        `IOException` - If an I/O error occurs

    - #### writeAttribute

          public void writeAttribute(ExportContext exportContext,
                                     String name,
                                     String value)
                              throws IOException

      Write an attribute on the current element. Override if reqd.
      Parameters:
        `exportContext` - the export context.
        `name` - the name of the attribute on the current element.
        `value` - of the attribute on the current element.
      Throws:
        `IOException` - If an I/O error occurs

    - #### createExportTarget

          protected Object createExportTarget(ExportContext exportContext)
                                       throws IOException

      Overridable hook for format handler to create export target. Default implementation is to get a writer.
      Parameters:
        `exportContext` - the export context.
      Returns:
        and object.
      Throws:
        `IOException` - If an I/O error occurs

    - #### getCurrentFormattingState

          public FormattingState getCurrentFormattingState()

      If a specific implementation require to maintain the formatting state/context ,the user of specific FormatHandler can get current FormattingState context.
      Returns:
        current FormattingState context

Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.