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:
JRExporter<ExporterInput,RC,C,O>,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 JRExporter<ExporterInput,RC,C,O>
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classJRAbstractExporter.BaseExporterContextclassJRAbstractExporter.PageRange
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protectedJRAbstractExporter(JasperReportsContext jasperReportsContext)
-
Method Summary
-
-
-
Field Detail
-
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_MIXED_CALLS_NOT_ALLOWED
public static final String EXCEPTION_MESSAGE_KEY_MIXED_CALLS_NOT_ALLOWED
- 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_FACTORYis 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
-
parameters
protected Map<JRExporterParameter,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 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()
-
setParameter
public void setParameter(JRExporterParameter parameter, Object value)
Deprecated.Description copied from interface:JRExporterSets 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:
setParameterin interfaceJRExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput,E extends JRExporterContext>- Parameters:
parameter- the parameter, selected from the static parameters defined by JasperReportsvalue- the parameter value- See Also:
JRExporterParameter
-
getParameter
public Object getParameter(JRExporterParameter parameter)
Deprecated.Description copied from interface:JRExporterGets an export parameter.- Specified by:
getParameterin interfaceJRExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput,E extends JRExporterContext>
-
setParameters
public void setParameters(Map<JRExporterParameter,Object> parameters)
Deprecated.Description copied from interface:JRExporterSets export parameters from a specified map.- Specified by:
setParametersin interfaceJRExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput,E extends JRExporterContext>- See Also:
JRExporter.setParameter(JRExporterParameter, Object)
-
getParameters
public Map<JRExporterParameter,Object> getParameters()
Deprecated.Description copied from interface:JRExporterGets a map containing all export parameters.- Specified by:
getParametersin interfaceJRExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput,E extends JRExporterContext>
-
getExporterInput
protected ExporterInput getExporterInput()
-
setExporterInput
public void setExporterInput(ExporterInput exporterInput)
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
public O getExporterOutput()
-
setExporterOutput
public void setExporterOutput(O exporterOutput)
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>
-
setConfiguration
public void setConfiguration(RC configuration)
- Specified by:
setConfigurationin interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput,E extends JRExporterContext>
-
setConfiguration
public void setConfiguration(C configuration)
- Specified by:
setConfigurationin 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:
setReportContextin interfaceExporter<RC extends ReportExportConfiguration,C extends ExporterConfiguration,O extends ExporterOutput,E extends JRExporterContext>
-
getReportContext
public ReportContext getReportContext()
- Specified by:
getReportContextin 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 JRExceptionDescription 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
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()
-
setClassLoader
protected void setClassLoader()
Deprecated.replaced bysetExportContext
-
resetClassLoader
protected void resetClassLoader()
Deprecated.replaced byresetExportContext
-
setCurrentExporterInputItem
protected void setCurrentExporterInputItem(ExporterInputItem crtItem)
-
getCurrentItemConfiguration
protected RC getCurrentItemConfiguration()
-
getCurrentConfiguration
protected C getCurrentConfiguration()
-
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 aframe.After the frame elements are exported, a call to
popElementOffsetsis 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:
ParseExceptionClassNotFoundException
-
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()
-
-