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 ClassesModifier and TypeClassDescriptionclassclass -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JRStyledTextAttributeSelectorprotected Cprotected RCprotected ExporterInputItemprotected Map<String, DateFormat> static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Cprotected Eprotected ExporterInputprotected Oprotected ExporterFilterprotected FontUtilprotected JRHyperlinkProducerFactoryprotected RCprotected JasperPrintprotected JasperReportsContextprotected JRStyledTextAttributeSelectorprotected JRStyledTextAttributeSelectorprotected Map<String, NumberFormat> protected JRPropertiesUtilstatic final StringA property that gives the generic default filter factory class name.static final StringThe suffix applied to properties that give the default filter factory for a specific exporter.protected RendererUtilprotected JRStyledTextUtil -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJRAbstractExporter(JasperReportsContext jasperReportsContext) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected ExporterFilterprotected NumberdefaultParseNumber(String textStr, Class<?> valueClass) protected voidprotected voidprotected voidabstract voidPerforms the export.protected TextValuegetBooleanCellValue(JRPrintText text, String textStr) protected Cprotected RCprotected TextValuegetDateCellValue(JRPrintText text, String textStr) protected DateFormatgetDateFormat(String formatFactoryClass, String pattern, Locale lc, TimeZone tz) protected ExporterInputabstract Stringabstract StringReturns the properties prefix for the current exporter.protected TextValuegetNumberCellValue(JRPrintText text, String textStr) protected NumberFormatgetNumberFormat(String formatFactoryClass, String pattern, Locale lc) protected intReturns the X axis offset used for element export.protected intReturns the Y axis offset used for element export.protected JRStyledTextgetStyledText(JRPrintText textElement) protected JRStyledTextgetStyledText(JRPrintText textElement, boolean setBackcolor) protected Stringprotected LocalegetTextLocale(JRPrintText text) protected TimeZonegetTextTimeZone(JRPrintText text) protected TextValuegetTextValue(JRPrintText text, String textStr) protected TextValuegetTextValueString(JRPrintText text, String textStr) protected voidprotected voidprotected booleanvoidreset()protected voidprotected voidRestores offsets after a call tosetFrameElementsOffset.voidsetConfiguration(C configuration) voidsetConfiguration(RC configuration) protected voidvoidsetExporterInput(ExporterInput exporterInput) Provides the input for this exporter.voidsetExporterOutput(O exporterOutput) Provides the output for this exporter.protected voidsetFrameElementsOffset(JRPrintFrame frame, boolean relative) Sets the offsets for exporting elements from aframe.protected voidsetJasperReportsContext(JasperReportsContext jasperReportsContext) protected voidprotected voidsetOffset(boolean setElementOffsets) voidsetReportContext(ReportContext reportContext)
-
Field Details
-
EXCEPTION_MESSAGE_KEY_EMPTY_INPUT_SOURCE_IN_BATCH_MODE
- See Also:
-
EXCEPTION_MESSAGE_KEY_NO_INPUT_SOURCE
- See Also:
-
EXCEPTION_MESSAGE_KEY_NO_OUTPUT_SPECIFIED
- See Also:
-
EXCEPTION_MESSAGE_KEY_START_PAGE_INDEX_OUT_OF_RANGE
- See Also:
-
EXCEPTION_MESSAGE_KEY_END_PAGE_INDEX_OUT_OF_RANGE
- See Also:
-
EXCEPTION_MESSAGE_KEY_INVALID_IMAGE_NAME
- See Also:
-
EXCEPTION_MESSAGE_KEY_INVALID_ZOOM_RATIO
- See Also:
-
EXCEPTION_MESSAGE_KEY_PAGE_INDEX_OUT_OF_RANGE
- See Also:
-
EXCEPTION_MESSAGE_KEY_OUTPUT_WRITER_ERROR
- See Also:
-
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_FACTORYis used.- See Also:
-
PROPERTY_DEFAULT_FILTER_FACTORY
A property that gives the generic default filter factory class name.- See Also:
-
jasperReportsContext
-
propertiesUtil
-
rendererUtil
-
allSelector
-
noBackcolorSelector
-
noneSelector
-
styledTextUtil
-
fontUtil
-
exporterInput
-
itemConfiguration
-
exporterConfiguration
-
exporterOutput
-
crtItem
-
crtCompositeItemConfiguration
-
crtCompositeConfiguration
-
jasperPrint
-
filter
-
dateFormatCache
-
numberFormatCache
-
textValueClasses
-
exporterContext
-
hyperlinkProducerFactory
-
-
Constructor Details
-
JRAbstractExporter
-
-
Method Details
-
reset
public void reset() -
getExporterInput
-
setExporterInput
Description copied from interface:ExporterProvides the input for this exporter.- Specified by:
setExporterInputin interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration, O extends ExporterOutput, E extends JRExporterContext>
-
getExporterOutput
-
setExporterOutput
Description copied from interface:ExporterProvides the output for this exporter.- Specified by:
setExporterOutputin interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration, O extends ExporterOutput, E extends JRExporterContext>
-
getReportExportConfiguration
-
getExporterConfiguration
-
setConfiguration
- Specified by:
setConfigurationin interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration, O extends ExporterOutput, E extends JRExporterContext>
-
setConfiguration
- Specified by:
setConfigurationin interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration, O extends ExporterOutput, E extends JRExporterContext>
-
getJasperReportsContext
-
setJasperReportsContext
-
setReportContext
- Specified by:
setReportContextin interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration, O extends ExporterOutput, E extends JRExporterContext>
-
getReportContext
- Specified by:
getReportContextin interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration, O extends ExporterOutput, E extends JRExporterContext>
-
getPropertiesUtil
-
getRendererUtil
-
getRepository
-
exportReport
Description copied from interface:ExporterPerforms the export.- Specified by:
exportReportin interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration, O extends ExporterOutput, E extends JRExporterContext> - Throws:
JRException
-
checkInterrupted
- Throws:
ExportInterruptedException
-
setOffset
protected void setOffset() -
setOffset
protected void setOffset(boolean setElementOffsets) -
ensureJasperReportsContext
protected void ensureJasperReportsContext() -
resetExportContext
protected void resetExportContext() -
setCurrentExporterInputItem
-
getCurrentItemConfiguration
-
getCurrentConfiguration
-
getConfigurationInterface
-
getItemConfigurationInterface
-
ensureInput
protected void ensureInput() -
ensureOutput
protected void ensureOutput() -
initExport
protected void initExport() -
initReport
protected void initReport() -
getPageRange
-
getStyledText
-
getStyledText
-
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
Sets the offsets for exporting elements from aframe.After the frame elements are exported, a call to
popElementOffsetsis required so that the previous offsets are restored.- Parameters:
frame-relative-- See Also:
-
restoreElementOffsets
protected void restoreElementOffsets()Restores offsets after a call tosetFrameElementsOffset. -
insideFrame
protected boolean insideFrame() -
getTextFormatFactoryClass
-
getLocale
-
getTextLocale
-
getTextTimeZone
-
getTextValue
-
getTextValueString
-
getDateCellValue
- Throws:
ParseException
-
getNumberCellValue
protected TextValue getNumberCellValue(JRPrintText text, String textStr) throws ParseException, ClassNotFoundException - Throws:
ParseExceptionClassNotFoundException
-
defaultParseNumber
-
getBooleanCellValue
-
getDateFormat
protected DateFormat getDateFormat(String formatFactoryClass, String pattern, Locale lc, TimeZone tz) -
getNumberFormat
-
createFilter
-
getHyperlinkProducer
-
getExporterKey
-
getExporterPropertiesPrefix
Returns the properties prefix for the current exporter.- Returns:
- the properties prefix for the current exporter
-
getExporterContext
-
getCurrentJasperPrint
-