net.sf.jasperreports.engine

## Class JRAbstractExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput,E extends JRExporterContext>

- java.lang.Object
- - net.sf.jasperreports.engine.JRAbstractExporter<RC,C,O,E>

- All Implemented Interfaces:
    JRExporter<ExporterInput,RC,C,O>, Exporter<ExporterInput,RC,C,O>
  Direct Known Subclasses:
    AbstractHtmlExporter, JRAbstractCsvExporter, JRDocxExporter, JRGraphics2DExporter, JROdtExporter, JRPdfExporter, JRPptxExporter, JRPrintServiceExporter, JRRtfExporter, JRTextExporter, JRXlsAbstractExporter, JRXmlExporter, JsonExporter

      public abstract class JRAbstractExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput,E extends JRExporterContext>
      extends java.lang.Object
      implements JRExporter<ExporterInput,RC,C,O>

  Version:
    $Id: JRAbstractExporter.java 7079 2014-05-07 09:19:25Z lucianc $
  Author:
    Teodor Danciu (teodord@users.sourceforge.net)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `JRAbstractExporter.BaseExporterContext`
    `protected class` | `JRAbstractExporter.PageRange`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected JRStyledTextAttributeSelector` | `allSelector`
    `protected C` | `crtCompositeConfiguration`
    `protected RC` | `crtCompositeItemConfiguration`
    `protected ExporterInputItem` | `crtItem`
    `protected java.util.Map<java.lang.String,java.text.DateFormat>` | `dateFormatCache`
    `static java.lang.String` | `EXCEPTION_MESSAGE_KEY_END_PAGE_INDEX_OUT_OF_RANGE`
    `static java.lang.String` | `EXCEPTION_MESSAGE_KEY_PAGE_INDEX_OUT_OF_RANGE`
    `static java.lang.String` | `EXCEPTION_MESSAGE_KEY_START_PAGE_INDEX_OUT_OF_RANGE`
    `protected C` | `exporterConfiguration`
    `protected E` | `exporterContext`
    `protected ExporterInput` | `exporterInput`
    `protected O` | `exporterOutput`
    `protected ExporterFilter` | `filter`
    `protected RC` | `itemConfiguration`
    `protected JasperPrint` | `jasperPrint`
    `protected JasperReportsContext` | `jasperReportsContext`
    `protected JRStyledTextAttributeSelector` | `noBackcolorSelector`
    `protected JRStyledTextAttributeSelector` | `noneSelector`
    `protected java.util.Map<java.lang.String,java.text.NumberFormat>` | `numberFormatCache`
    `protected java.util.Map<JRExporterParameter,java.lang.Object>` | `parameters`
    `protected JRPropertiesUtil` | `propertiesUtil`
    `static java.lang.String` | `PROPERTY_DEFAULT_FILTER_FACTORY` A property that gives the generic default filter factory class name.
    `static java.lang.String` | `PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY` The suffix applied to properties that give the default filter factory for a specific exporter.
    `protected JRStyledTextUtil` | `styledTextUtil`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `JRAbstractExporter()` Deprecated. Replaced by `JRAbstractExporter(JasperReportsContext)`.
    `protected` | `JRAbstractExporter(JasperReportsContext jasperReportsContext)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected ExporterFilter` | `createFilter()`
    `protected java.lang.Number` | `defaultParseNumber(java.lang.String textStr, java.lang.Class<?> valueClass)`
    `protected void` | `ensureInput()`
    `protected void` | `ensureJasperReportsContext()`
    `protected abstract void` | `ensureOutput()`
    `abstract void` | `exportReport()` Performs the export.
    `protected TextValue` | `getBooleanCellValue(JRPrintText text, java.lang.String textStr)`
    `protected abstract java.lang.Class<C>` | `getConfigurationInterface()`
    `protected C` | `getCurrentConfiguration()`
    `protected RC` | `getCurrentItemConfiguration()`
    `JasperPrint` | `getCurrentJasperPrint()`
    `protected JRHyperlinkProducer` | `getCustomHandler(JRPrintHyperlink link)` Deprecated. Replaced by `getHyperlinkProducer(JRPrintHyperlink)`.
    `protected TextValue` | `getDateCellValue(JRPrintText text, java.lang.String textStr)`
    `protected java.text.DateFormat` | `getDateFormat(java.lang.String formatFactoryClass, java.lang.String pattern, java.util.Locale lc, java.util.TimeZone tz)`
    `E` | `getExporterContext()`
    `protected ExporterInput` | `getExporterInput()`
    `abstract java.lang.String` | `getExporterKey()`
    `protected O` | `getExporterOutput()`
    `abstract java.lang.String` | `getExporterPropertiesPrefix()` Returns the properties prefix for the current exporter.
    `JRHyperlinkProducer` | `getHyperlinkProducer(JRPrintHyperlink link)`
    `protected abstract java.lang.Class<RC>` | `getItemConfigurationInterface()`
    `JasperReportsContext` | `getJasperReportsContext()`
    `protected java.util.Locale` | `getLocale()`
    `protected TextValue` | `getNumberCellValue(JRPrintText text, java.lang.String textStr)`
    `protected java.text.NumberFormat` | `getNumberFormat(java.lang.String formatFactoryClass, java.lang.String pattern, java.util.Locale lc)`
    `protected int` | `getOffsetX()` Returns the X axis offset used for element export.
    `protected int` | `getOffsetY()` Returns the Y axis offset used for element export.
    `protected JRAbstractExporter.PageRange` | `getPageRange()`
    `java.lang.Object` | `getParameter(JRExporterParameter parameter)` Deprecated. Replaced by `setExporterInput(ExporterInput)`, `setConfiguration(ExporterConfiguration)`, `setConfiguration(ReportExportConfiguration)` and `setExporterOutput(ExporterOutput)`.
    `java.util.Map<JRExporterParameter,java.lang.Object>` | `getParameters()` Deprecated. Replaced by `setExporterInput(ExporterInput)`, `setConfiguration(ExporterConfiguration)`, `setConfiguration(ReportExportConfiguration)` and `setExporterOutput(ExporterOutput)`
    `JRPropertiesUtil` | `getPropertiesUtil()`
    `ReportContext` | `getReportContext()`
    `protected JRStyledText` | `getStyledText(JRPrintText textElement)`
    `protected JRStyledText` | `getStyledText(JRPrintText textElement, boolean setBackcolor)`
    `protected java.lang.String` | `getTextFormatFactoryClass(JRPrintText text)`
    `protected java.util.Locale` | `getTextLocale(JRPrintText text)`
    `protected java.util.TimeZone` | `getTextTimeZone(JRPrintText text)`
    `protected TextValue` | `getTextValue(JRPrintText text, java.lang.String textStr)`
    `protected TextValue` | `getTextValueString(JRPrintText text, java.lang.String textStr)`
    `protected void` | `initExport()`
    `protected void` | `initReport()`
    `void` | `reset()`
    `protected void` | `resetClassLoader()` Deprecated. replaced by `resetExportContext`
    `protected void` | `resetExportContext()`
    `protected void` | `restoreElementOffsets()` Restores offsets after a call to `setFrameElementsOffset`.
    `protected void` | `setClassLoader()` Deprecated. replaced by `setExportContext`
    `void` | `setConfiguration(C configuration)`
    `void` | `setConfiguration(RC configuration)`
    `protected void` | `setCurrentExporterInputItem(ExporterInputItem crtItem)`
    `void` | `setExporterInput(ExporterInput exporterInput)` Provides the input for this exporter.
    `void` | `setExporterOutput(O exporterOutput)` Provides the output for this exporter.
    `protected void` | `setFrameElementsOffset(JRPrintFrame frame, boolean relative)` Sets the offsets for exporting elements from a `frame`.
    `protected void` | `setJasperPrint(JasperPrint jasperPrint)` Deprecated. Replaced by `setCurrentExporterInputItem(ExporterInputItem)`.
    `protected void` | `setJasperReportsContext(JasperReportsContext jasperReportsContext)`
    `protected void` | `setOffset()`
    `protected void` | `setOffset(boolean setElementOffsets)`
    `void` | `setParameter(JRExporterParameter parameter, java.lang.Object value)` Deprecated. Replaced by `setExporterInput(ExporterInput)`, `setConfiguration(ExporterConfiguration)`, `setConfiguration(ReportExportConfiguration)` and `setExporterOutput(ExporterOutput)`
    `void` | `setParameters(java.util.Map<JRExporterParameter,java.lang.Object> parameters)` Deprecated. Replaced by `setExporterInput(ExporterInput)`, `setConfiguration(ExporterConfiguration)`, `setConfiguration(ReportExportConfiguration)` and `setExporterOutput(ExporterOutput)`
    `void` | `setReportContext(ReportContext reportContext)`

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

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

- - ### Field Detail

    - #### EXCEPTION_MESSAGE_KEY_START_PAGE_INDEX_OUT_OF_RANGE

          public static final java.lang.String EXCEPTION_MESSAGE_KEY_START_PAGE_INDEX_OUT_OF_RANGE

    - #### EXCEPTION_MESSAGE_KEY_END_PAGE_INDEX_OUT_OF_RANGE

          public static final java.lang.String EXCEPTION_MESSAGE_KEY_END_PAGE_INDEX_OUT_OF_RANGE

    - #### EXCEPTION_MESSAGE_KEY_PAGE_INDEX_OUT_OF_RANGE

          public static final java.lang.String EXCEPTION_MESSAGE_KEY_PAGE_INDEX_OUT_OF_RANGE

    - #### PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY

          public static final java.lang.String PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY

      The suffix applied to properties that give the default filter factory for a specific exporter. For instance, the default filter factory for XLS exporters is `net.sf.jasperreports.export.xls.default.filter.factory`. If this property is not defined for a specific exporter, the generic exporter factory given by `PROPERTY_DEFAULT_FILTER_FACTORY` is used.
      See Also:
        Constant Field Values

    - #### PROPERTY_DEFAULT_FILTER_FACTORY

          public static final java.lang.String PROPERTY_DEFAULT_FILTER_FACTORY

      A property that gives the generic default filter factory class name.
      See Also:
        `PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY`, Constant Field Values

    - #### jasperReportsContext

          protected JasperReportsContext jasperReportsContext

    - #### propertiesUtil

          protected JRPropertiesUtil propertiesUtil

    - #### allSelector

          protected JRStyledTextAttributeSelector allSelector

    - #### noBackcolorSelector

          protected JRStyledTextAttributeSelector noBackcolorSelector

    - #### noneSelector

          protected JRStyledTextAttributeSelector noneSelector

    - #### styledTextUtil

          protected JRStyledTextUtil styledTextUtil

    - #### parameters

          protected java.util.Map<JRExporterParameter,java.lang.Object> parameters

    - #### exporterInput

          protected ExporterInput exporterInput

    - #### itemConfiguration

          protected RC extends ReportExportConfiguration itemConfiguration

    - #### exporterConfiguration

          protected C extends ExporterConfiguration exporterConfiguration

    - #### exporterOutput

          protected O extends ExporterOutput exporterOutput

    - #### crtItem

          protected ExporterInputItem crtItem

    - #### crtCompositeItemConfiguration

          protected RC extends ReportExportConfiguration crtCompositeItemConfiguration

    - #### crtCompositeConfiguration

          protected C extends ExporterConfiguration crtCompositeConfiguration

    - #### jasperPrint

          protected JasperPrint jasperPrint

    - #### filter

          protected ExporterFilter filter

    - #### dateFormatCache

          protected java.util.Map<java.lang.String,java.text.DateFormat> dateFormatCache

    - #### numberFormatCache

          protected java.util.Map<java.lang.String,java.text.NumberFormat> numberFormatCache

    - #### exporterContext

          protected E extends JRExporterContext exporterContext

  - ### Constructor Detail

    - #### JRAbstractExporter

          protected JRAbstractExporter()

      Deprecated. Replaced by `JRAbstractExporter(JasperReportsContext)`.

    - #### JRAbstractExporter

          protected JRAbstractExporter(JasperReportsContext jasperReportsContext)

  - ### Method Detail

    - #### reset

          public void reset()

    - #### setParameter

          public void setParameter(JRExporterParameter parameter,
                          java.lang.Object value)

      Deprecated. Replaced by `setExporterInput(ExporterInput)`, `setConfiguration(ExporterConfiguration)`, `setConfiguration(ReportExportConfiguration)` and `setExporterOutput(ExporterOutput)`
      Description copied from interface: `JRExporter`
      Sets an export parameter for advanced customization of the export process. Parameters can be either common parameters or specialized ones, depending on the exporter type.
      Specified by:
        `setParameter` in interface `JRExporter<ExporterInput,RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput>`
      Parameters:
        `parameter` - the parameter, selected from the static parameters defined by JasperReports
        `value` - the parameter value
      See Also:
        `JRExporterParameter`

    - #### getParameter

          public java.lang.Object getParameter(JRExporterParameter parameter)

      Deprecated. Replaced by `setExporterInput(ExporterInput)`, `setConfiguration(ExporterConfiguration)`, `setConfiguration(ReportExportConfiguration)` and `setExporterOutput(ExporterOutput)`.
      Description copied from interface: `JRExporter`
      Gets an export parameter.
      Specified by:
        `getParameter` in interface `JRExporter<ExporterInput,RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput>`

    - #### setParameters

          public void setParameters(java.util.Map<JRExporterParameter,java.lang.Object> parameters)

      Deprecated. Replaced by `setExporterInput(ExporterInput)`, `setConfiguration(ExporterConfiguration)`, `setConfiguration(ReportExportConfiguration)` and `setExporterOutput(ExporterOutput)`
      Description copied from interface: `JRExporter`
      Sets export parameters from a specified map.
      Specified by:
        `setParameters` in interface `JRExporter<ExporterInput,RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput>`
      See Also:
        `JRExporter.setParameter(JRExporterParameter, Object)`

    - #### getParameters

          public java.util.Map<JRExporterParameter,java.lang.Object> getParameters()

      Deprecated. Replaced by `setExporterInput(ExporterInput)`, `setConfiguration(ExporterConfiguration)`, `setConfiguration(ReportExportConfiguration)` and `setExporterOutput(ExporterOutput)`
      Description copied from interface: `JRExporter`
      Gets a map containing all export parameters.
      Specified by:
        `getParameters` in interface `JRExporter<ExporterInput,RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput>`

    - #### getExporterInput

          protected ExporterInput getExporterInput()

    - #### setExporterInput

          public void setExporterInput(ExporterInput exporterInput)

      Description copied from interface: `Exporter`
      Provides the input for this exporter.
      Specified by:
        `setExporterInput` in interface `Exporter<ExporterInput,RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput>`

    - #### getExporterOutput

          protected O getExporterOutput()

    - #### setExporterOutput

          public void setExporterOutput(O exporterOutput)

      Description copied from interface: `Exporter`
      Provides the output for this exporter.
      Specified by:
        `setExporterOutput` in interface `Exporter<ExporterInput,RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput>`

    - #### setConfiguration

          public void setConfiguration(RC configuration)

      Specified by:
        `setConfiguration` in interface `Exporter<ExporterInput,RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput>`

    - #### setConfiguration

          public void setConfiguration(C configuration)

      Specified by:
        `setConfiguration` in interface `Exporter<ExporterInput,RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput>`

    - #### getJasperReportsContext

          public JasperReportsContext getJasperReportsContext()

    - #### setJasperReportsContext

          protected void setJasperReportsContext(JasperReportsContext jasperReportsContext)

    - #### setReportContext

          public void setReportContext(ReportContext reportContext)

      Specified by:
        `setReportContext` in interface `Exporter<ExporterInput,RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput>`

    - #### getReportContext

          public ReportContext getReportContext()

      Specified by:
        `getReportContext` in interface `Exporter<ExporterInput,RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput>`

    - #### getPropertiesUtil

          public JRPropertiesUtil getPropertiesUtil()

    - #### exportReport

          public abstract void exportReport()
                                     throws JRException

      Description copied from interface: `Exporter`
      Performs the export.
      Specified by:
        `exportReport` in interface `Exporter<ExporterInput,RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput>`
      Throws:
        `JRException`

    - #### setOffset

          protected void setOffset()

    - #### setOffset

          protected void setOffset(boolean setElementOffsets)

    - #### ensureJasperReportsContext

          protected void ensureJasperReportsContext()

    - #### resetExportContext

          protected void resetExportContext()

    - #### setClassLoader

          protected void setClassLoader()

      Deprecated. replaced by `setExportContext`

    - #### resetClassLoader

          protected void resetClassLoader()

      Deprecated. replaced by `resetExportContext`

    - #### setCurrentExporterInputItem

          protected void setCurrentExporterInputItem(ExporterInputItem crtItem)

    - #### getCurrentItemConfiguration

          protected RC getCurrentItemConfiguration()

    - #### getCurrentConfiguration

          protected C getCurrentConfiguration()

    - #### setJasperPrint

          protected void setJasperPrint(JasperPrint jasperPrint)

      Deprecated. Replaced by `setCurrentExporterInputItem(ExporterInputItem)`.

    - #### getConfigurationInterface

          protected abstract java.lang.Class<C> getConfigurationInterface()

    - #### getItemConfigurationInterface

          protected abstract java.lang.Class<RC> getItemConfigurationInterface()

    - #### ensureInput

          protected void ensureInput()

    - #### ensureOutput

          protected abstract void ensureOutput()

    - #### initExport

          protected void initExport()

    - #### initReport

          protected void initReport()

    - #### getPageRange

          protected JRAbstractExporter.PageRange getPageRange()

    - #### getStyledText

          protected JRStyledText getStyledText(JRPrintText textElement,
                                   boolean setBackcolor)

    - #### getStyledText

          protected JRStyledText getStyledText(JRPrintText textElement)

    - #### getOffsetX

          protected int getOffsetX()

      Returns the X axis offset used for element export.
      Returns:
        the X axis offset

    - #### getOffsetY

          protected int getOffsetY()

      Returns the Y axis offset used for element export.
      Returns:
        the Y axis offset

    - #### setFrameElementsOffset

          protected void setFrameElementsOffset(JRPrintFrame frame,
                                    boolean relative)

      Sets the offsets for exporting elements from a `frame`.

      After the frame elements are exported, a call to `popElementOffsets` is required so that the previous offsets are restored.

      Parameters:
        `frame` -
        `relative` -
      See Also:
        `getOffsetX()`, `getOffsetY()`, `restoreElementOffsets()`

    - #### restoreElementOffsets

          protected void restoreElementOffsets()

      Restores offsets after a call to `setFrameElementsOffset`.

    - #### getTextFormatFactoryClass

          protected java.lang.String getTextFormatFactoryClass(JRPrintText text)

    - #### getLocale

          protected java.util.Locale getLocale()

    - #### getTextLocale

          protected java.util.Locale getTextLocale(JRPrintText text)

    - #### getTextTimeZone

          protected java.util.TimeZone getTextTimeZone(JRPrintText text)

    - #### getTextValue

          protected TextValue getTextValue(JRPrintText text,
                               java.lang.String textStr)

    - #### getTextValueString

          protected TextValue getTextValueString(JRPrintText text,
                                     java.lang.String textStr)

    - #### getDateCellValue

          protected TextValue getDateCellValue(JRPrintText text,
                                   java.lang.String textStr)
                                        throws java.text.ParseException

      Throws:
        `java.text.ParseException`

    - #### getNumberCellValue

          protected TextValue getNumberCellValue(JRPrintText text,
                                     java.lang.String textStr)
                                          throws java.text.ParseException,
                                                 java.lang.ClassNotFoundException

      Throws:
        `java.text.ParseException`
        `java.lang.ClassNotFoundException`

    - #### defaultParseNumber

          protected java.lang.Number defaultParseNumber(java.lang.String textStr,
                                            java.lang.Class<?> valueClass)

    - #### getBooleanCellValue

          protected TextValue getBooleanCellValue(JRPrintText text,
                                      java.lang.String textStr)

    - #### getDateFormat

          protected java.text.DateFormat getDateFormat(java.lang.String formatFactoryClass,
                                           java.lang.String pattern,
                                           java.util.Locale lc,
                                           java.util.TimeZone tz)

    - #### getNumberFormat

          protected java.text.NumberFormat getNumberFormat(java.lang.String formatFactoryClass,
                                               java.lang.String pattern,
                                               java.util.Locale lc)

    - #### createFilter

          protected ExporterFilter createFilter()

    - #### getHyperlinkProducer

          public JRHyperlinkProducer getHyperlinkProducer(JRPrintHyperlink link)

    - #### getCustomHandler

          protected JRHyperlinkProducer getCustomHandler(JRPrintHyperlink link)

      Deprecated. Replaced by `getHyperlinkProducer(JRPrintHyperlink)`.

    - #### getExporterKey

          public abstract java.lang.String getExporterKey()

    - #### getExporterPropertiesPrefix

          public abstract java.lang.String getExporterPropertiesPrefix()

      Returns the properties prefix for the current exporter.
      Returns:
        the properties prefix for the current exporter

    - #### getExporterContext

          public E getExporterContext()

    - #### getCurrentJasperPrint

          public JasperPrint getCurrentJasperPrint()

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com