Package 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:
Exporter<ExporterInput,RC,C,O>
- Direct Known Subclasses:
AbstractHtmlExporter
,ExcelAbstractExporter
,JRAbstractCsvExporter
,JRDocxExporter
,JRGraphics2DExporter
,JROdtExporter
,JRPdfExporter
,JRPptxExporter
,JRPrintServiceExporter
,JRRtfExporter
,JRTextExporter
,JRXmlExporter
,JsonExporter
,JsonMetadataExporter
public abstract class JRAbstractExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput,E extends JRExporterContext> extends Object implements Exporter<ExporterInput,RC,C,O>
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
JRAbstractExporter.BaseExporterContext
class
JRAbstractExporter.PageRange
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
JRAbstractExporter(JasperReportsContext jasperReportsContext)
-
Method Summary
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_EMPTY_INPUT_SOURCE_IN_BATCH_MODE
public static final String EXCEPTION_MESSAGE_KEY_EMPTY_INPUT_SOURCE_IN_BATCH_MODE
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_NO_INPUT_SOURCE
public static final String EXCEPTION_MESSAGE_KEY_NO_INPUT_SOURCE
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_NO_OUTPUT_SPECIFIED
public static final String EXCEPTION_MESSAGE_KEY_NO_OUTPUT_SPECIFIED
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_START_PAGE_INDEX_OUT_OF_RANGE
public static final String EXCEPTION_MESSAGE_KEY_START_PAGE_INDEX_OUT_OF_RANGE
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_END_PAGE_INDEX_OUT_OF_RANGE
public static final String EXCEPTION_MESSAGE_KEY_END_PAGE_INDEX_OUT_OF_RANGE
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_INVALID_IMAGE_NAME
public static final String EXCEPTION_MESSAGE_KEY_INVALID_IMAGE_NAME
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_INVALID_ZOOM_RATIO
public static final String EXCEPTION_MESSAGE_KEY_INVALID_ZOOM_RATIO
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_PAGE_INDEX_OUT_OF_RANGE
public static final String EXCEPTION_MESSAGE_KEY_PAGE_INDEX_OUT_OF_RANGE
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_OUTPUT_WRITER_ERROR
public static final String EXCEPTION_MESSAGE_KEY_OUTPUT_WRITER_ERROR
- See Also:
- Constant Field Values
-
PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY
public static final 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 isnet.sf.jasperreports.export.xls.default.filter.factory
. If this property is not defined for a specific exporter, the generic exporter factory given byPROPERTY_DEFAULT_FILTER_FACTORY
is used.- See Also:
- Constant Field Values
-
PROPERTY_DEFAULT_FILTER_FACTORY
public static final String PROPERTY_DEFAULT_FILTER_FACTORY
A property that gives the generic default filter factory class name.
-
jasperReportsContext
protected JasperReportsContext jasperReportsContext
-
propertiesUtil
protected JRPropertiesUtil propertiesUtil
-
rendererUtil
protected RendererUtil rendererUtil
-
allSelector
protected JRStyledTextAttributeSelector allSelector
-
noBackcolorSelector
protected JRStyledTextAttributeSelector noBackcolorSelector
-
noneSelector
protected JRStyledTextAttributeSelector noneSelector
-
styledTextUtil
protected JRStyledTextUtil styledTextUtil
-
fontUtil
protected FontUtil fontUtil
-
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 Map<String,DateFormat> dateFormatCache
-
numberFormatCache
protected Map<String,NumberFormat> numberFormatCache
-
exporterContext
protected E extends JRExporterContext exporterContext
-
hyperlinkProducerFactory
protected JRHyperlinkProducerFactory hyperlinkProducerFactory
-
-
Constructor Detail
-
JRAbstractExporter
protected JRAbstractExporter(JasperReportsContext jasperReportsContext)
-
-
Method Detail
-
reset
public void reset()
-
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 interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput,E extends JRExporterContext>
-
getExporterOutput
public O getExporterOutput()
-
setExporterOutput
public void setExporterOutput(O exporterOutput)
Description copied from interface:Exporter
Provides the output for this exporter.- Specified by:
setExporterOutput
in interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput,E extends JRExporterContext>
-
getReportExportConfiguration
public RC getReportExportConfiguration()
-
getExporterConfiguration
public C getExporterConfiguration()
-
setConfiguration
public void setConfiguration(RC configuration)
- Specified by:
setConfiguration
in interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput,E extends JRExporterContext>
-
setConfiguration
public void setConfiguration(C configuration)
- Specified by:
setConfiguration
in interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput,E extends JRExporterContext>
-
getJasperReportsContext
public JasperReportsContext getJasperReportsContext()
-
setJasperReportsContext
protected void setJasperReportsContext(JasperReportsContext jasperReportsContext)
-
setReportContext
public void setReportContext(ReportContext reportContext)
- Specified by:
setReportContext
in interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput,E extends JRExporterContext>
-
getReportContext
public ReportContext getReportContext()
- Specified by:
getReportContext
in interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput,E extends JRExporterContext>
-
getPropertiesUtil
public JRPropertiesUtil getPropertiesUtil()
-
getRendererUtil
public RendererUtil getRendererUtil()
-
getRepository
public RepositoryUtil getRepository()
-
exportReport
public abstract void exportReport() throws JRException
Description copied from interface:Exporter
Performs the export.- Specified by:
exportReport
in interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput,E extends JRExporterContext>
- Throws:
JRException
-
checkInterrupted
protected void checkInterrupted() throws ExportInterruptedException
- Throws:
ExportInterruptedException
-
setOffset
protected void setOffset()
-
setOffset
protected void setOffset(boolean setElementOffsets)
-
ensureJasperReportsContext
protected void ensureJasperReportsContext()
-
resetExportContext
protected void resetExportContext()
-
setCurrentExporterInputItem
protected void setCurrentExporterInputItem(ExporterInputItem crtItem)
-
getCurrentItemConfiguration
protected RC getCurrentItemConfiguration()
-
getCurrentConfiguration
protected C getCurrentConfiguration()
-
ensureInput
protected void ensureInput()
-
ensureOutput
protected 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 aframe
.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 tosetFrameElementsOffset
.
-
insideFrame
protected boolean insideFrame()
-
getTextFormatFactoryClass
protected String getTextFormatFactoryClass(JRPrintText text)
-
getLocale
public Locale getLocale()
-
getTextLocale
protected Locale getTextLocale(JRPrintText text)
-
getTextTimeZone
protected TimeZone getTextTimeZone(JRPrintText text)
-
getTextValue
protected TextValue getTextValue(JRPrintText text, String textStr)
-
getTextValueString
protected TextValue getTextValueString(JRPrintText text, String textStr)
-
getDateCellValue
protected TextValue getDateCellValue(JRPrintText text, String textStr) throws ParseException
- Throws:
ParseException
-
getNumberCellValue
protected TextValue getNumberCellValue(JRPrintText text, String textStr) throws ParseException, ClassNotFoundException
- Throws:
ParseException
ClassNotFoundException
-
getBooleanCellValue
protected TextValue getBooleanCellValue(JRPrintText text, String textStr)
-
getDateFormat
protected DateFormat getDateFormat(String formatFactoryClass, String pattern, Locale lc, TimeZone tz)
-
getNumberFormat
protected NumberFormat getNumberFormat(String formatFactoryClass, String pattern, Locale lc)
-
createFilter
protected ExporterFilter createFilter()
-
getHyperlinkProducer
public JRHyperlinkProducer getHyperlinkProducer(JRPrintHyperlink link)
-
getExporterKey
public abstract String getExporterKey()
-
getExporterPropertiesPrefix
public abstract 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()
-
-