Class JsonExporter
- java.lang.Object
-
- net.sf.jasperreports.engine.JRAbstractExporter<JsonReportConfiguration,JsonExporterConfiguration,JsonExporterOutput,JsonExporterContext>
-
- net.sf.jasperreports.engine.export.JsonExporter
-
- All Implemented Interfaces:
JRExporter<ExporterInput,JsonReportConfiguration,JsonExporterConfiguration,JsonExporterOutput>,Exporter<ExporterInput,JsonReportConfiguration,JsonExporterConfiguration,JsonExporterOutput>
public class JsonExporter extends JRAbstractExporter<JsonReportConfiguration,JsonExporterConfiguration,JsonExporterOutput,JsonExporterContext>
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classJsonExporter.ExporterContextprotected static interfaceJsonExporter.PrintBookmarkMixin-
Nested classes/interfaces inherited from class net.sf.jasperreports.engine.JRAbstractExporter
JRAbstractExporter.BaseExporterContext, JRAbstractExporter.PageRange
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringJSON_EXPORTER_KEYprotected static java.lang.StringJSON_EXPORTER_PROPERTIES_PREFIXprotected intpageIndexstatic java.lang.StringREPORT_CONTEXT_PARAMETER_WEB_FONTSprotected intreportIndexprotected java.io.Writerwriter-
Fields inherited from class net.sf.jasperreports.engine.JRAbstractExporter
allSelector, crtCompositeConfiguration, crtCompositeItemConfiguration, crtItem, dateFormatCache, EXCEPTION_MESSAGE_KEY_END_PAGE_INDEX_OUT_OF_RANGE, EXCEPTION_MESSAGE_KEY_INVALID_IMAGE_NAME, EXCEPTION_MESSAGE_KEY_INVALID_ZOOM_RATIO, EXCEPTION_MESSAGE_KEY_MIXED_CALLS_NOT_ALLOWED, EXCEPTION_MESSAGE_KEY_OUTPUT_WRITER_ERROR, EXCEPTION_MESSAGE_KEY_PAGE_INDEX_OUT_OF_RANGE, EXCEPTION_MESSAGE_KEY_START_PAGE_INDEX_OUT_OF_RANGE, exporterConfiguration, exporterContext, exporterInput, exporterOutput, filter, fontUtil, hyperlinkProducerFactory, itemConfiguration, jasperPrint, jasperReportsContext, noBackcolorSelector, noneSelector, numberFormatCache, parameters, propertiesUtil, PROPERTY_DEFAULT_FILTER_FACTORY, PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY, rendererUtil, styledTextUtil, textValueClasses
-
-
Constructor Summary
Constructors Constructor Description JsonExporter()JsonExporter(JasperReportsContext jasperReportsContext)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddFontFamily(HtmlFontFamily htmlFontFamily)voidaddHyperlinkData(HyperlinkData hyperlinkData)protected voidensureOutput()protected voidexportBookmarks()protected voidexportClickableElements()protected voidexportElements(java.util.Collection<JRPrintElement> elements)protected voidexportFrame(JRPrintFrame frame)protected voidexportGenericElement(JRGenericPrintElement element)protected voidexportHyperlinks()protected voidexportPage(JRPrintPage page)protected voidexportParts()voidexportReport()Performs the export.protected voidexportReportConfig()protected voidexportReportToWriter()protected voidexportWebFonts()protected java.lang.Class<JsonExporterConfiguration>getConfigurationInterface()java.lang.StringgetExporterKey()java.lang.StringgetExporterPropertiesPrefix()Returns the properties prefix for the current exporter.protected java.lang.Class<JsonReportConfiguration>getItemConfigurationInterface()protected voidinitExport()protected voidinitReport()protected java.lang.StringresolveHyperlinkURL(int reportIndex, JRPrintHyperlink link)static voidwriteBookmarks(java.util.List<PrintBookmark> bookmarks, java.io.Writer writer, JacksonUtil jacksonUtil)static voidwriteBookmarks(java.util.List<PrintBookmark> bookmarks, java.io.Writer writer, JacksonUtil jacksonUtil)Deprecated.Replaced bywriteBookmarks(List, Writer, JacksonUtil).static voidwriteParts(JasperPrint jasperPrint, java.io.Writer writer)static voidwriteParts(JasperPrint jasperPrint, PrintParts parts, java.io.Writer writer)static voidwriteParts(JasperReportsContext jasperReportsContext, JasperPrint jasperPrint, java.io.Writer writer)-
Methods inherited from class net.sf.jasperreports.engine.JRAbstractExporter
checkInterrupted, createFilter, defaultParseNumber, ensureInput, ensureJasperReportsContext, getBooleanCellValue, getCurrentConfiguration, getCurrentItemConfiguration, getCurrentJasperPrint, getDateCellValue, getDateFormat, getExporterContext, getExporterInput, getExporterOutput, getHyperlinkProducer, getJasperReportsContext, getLocale, getNumberCellValue, getNumberFormat, getOffsetX, getOffsetY, getPageRange, getParameter, getParameters, getPropertiesUtil, getRendererUtil, getReportContext, getRepository, getStyledText, getStyledText, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, insideFrame, reset, resetClassLoader, resetExportContext, restoreElementOffsets, setClassLoader, setConfiguration, setConfiguration, setCurrentExporterInputItem, setExporterInput, setExporterOutput, setFrameElementsOffset, setJasperReportsContext, setOffset, setOffset, setParameter, setParameters, setReportContext
-
-
-
-
Field Detail
-
REPORT_CONTEXT_PARAMETER_WEB_FONTS
public static final java.lang.String REPORT_CONTEXT_PARAMETER_WEB_FONTS
- See Also:
- Constant Field Values
-
JSON_EXPORTER_KEY
public static final java.lang.String JSON_EXPORTER_KEY
- See Also:
- Constant Field Values
-
JSON_EXPORTER_PROPERTIES_PREFIX
protected static final java.lang.String JSON_EXPORTER_PROPERTIES_PREFIX
- See Also:
- Constant Field Values
-
writer
protected java.io.Writer writer
-
reportIndex
protected int reportIndex
-
pageIndex
protected int pageIndex
-
-
Constructor Detail
-
JsonExporter
public JsonExporter()
-
JsonExporter
public JsonExporter(JasperReportsContext jasperReportsContext)
-
-
Method Detail
-
getConfigurationInterface
protected java.lang.Class<JsonExporterConfiguration> getConfigurationInterface()
- Specified by:
getConfigurationInterfacein classJRAbstractExporter<JsonReportConfiguration,JsonExporterConfiguration,JsonExporterOutput,JsonExporterContext>
-
getItemConfigurationInterface
protected java.lang.Class<JsonReportConfiguration> getItemConfigurationInterface()
-
ensureOutput
protected void ensureOutput()
- Specified by:
ensureOutputin classJRAbstractExporter<JsonReportConfiguration,JsonExporterConfiguration,JsonExporterOutput,JsonExporterContext>
-
getExporterKey
public java.lang.String getExporterKey()
- Specified by:
getExporterKeyin classJRAbstractExporter<JsonReportConfiguration,JsonExporterConfiguration,JsonExporterOutput,JsonExporterContext>
-
getExporterPropertiesPrefix
public java.lang.String getExporterPropertiesPrefix()
Description copied from class:JRAbstractExporterReturns the properties prefix for the current exporter.- Specified by:
getExporterPropertiesPrefixin classJRAbstractExporter<JsonReportConfiguration,JsonExporterConfiguration,JsonExporterOutput,JsonExporterContext>- Returns:
- the properties prefix for the current exporter
-
exportReport
public void exportReport() throws JRExceptionDescription copied from interface:ExporterPerforms the export.- Specified by:
exportReportin interfaceExporter<ExporterInput,JsonReportConfiguration,JsonExporterConfiguration,JsonExporterOutput>- Specified by:
exportReportin classJRAbstractExporter<JsonReportConfiguration,JsonExporterConfiguration,JsonExporterOutput,JsonExporterContext>- Throws:
JRException
-
initExport
protected void initExport()
- Overrides:
initExportin classJRAbstractExporter<JsonReportConfiguration,JsonExporterConfiguration,JsonExporterOutput,JsonExporterContext>
-
initReport
protected void initReport()
- Overrides:
initReportin classJRAbstractExporter<JsonReportConfiguration,JsonExporterConfiguration,JsonExporterOutput,JsonExporterContext>
-
exportReportToWriter
protected void exportReportToWriter() throws JRException, java.io.IOException- Throws:
JRExceptionjava.io.IOException
-
exportPage
protected void exportPage(JRPrintPage page) throws java.io.IOException, ExportInterruptedException
- Throws:
java.io.IOExceptionExportInterruptedException
-
exportElements
protected void exportElements(java.util.Collection<JRPrintElement> elements) throws java.io.IOException, ExportInterruptedException
- Throws:
java.io.IOExceptionExportInterruptedException
-
exportFrame
protected void exportFrame(JRPrintFrame frame) throws java.io.IOException, ExportInterruptedException
- Throws:
java.io.IOExceptionExportInterruptedException
-
exportBookmarks
protected void exportBookmarks() throws java.io.IOException- Throws:
java.io.IOException
-
exportReportConfig
protected void exportReportConfig() throws java.io.IOException- Throws:
java.io.IOException
-
writeBookmarks
public static void writeBookmarks(java.util.List<PrintBookmark> bookmarks, java.io.Writer writer, JacksonUtil jacksonUtil) throws java.io.IOException
- Throws:
java.io.IOException
-
writeBookmarks
public static void writeBookmarks(java.util.List<PrintBookmark> bookmarks, java.io.Writer writer, JacksonUtil jacksonUtil) throws java.io.IOException
Deprecated.Replaced bywriteBookmarks(List, Writer, JacksonUtil).- Throws:
java.io.IOException
-
exportParts
protected void exportParts() throws java.io.IOException- Throws:
java.io.IOException
-
writeParts
public static void writeParts(JasperPrint jasperPrint, java.io.Writer writer) throws java.io.IOException
- Throws:
java.io.IOException
-
writeParts
public static void writeParts(JasperReportsContext jasperReportsContext, JasperPrint jasperPrint, java.io.Writer writer) throws java.io.IOException
- Throws:
java.io.IOException
-
writeParts
public static void writeParts(JasperPrint jasperPrint, PrintParts parts, java.io.Writer writer) throws java.io.IOException
- Throws:
java.io.IOException
-
exportWebFonts
protected void exportWebFonts() throws java.io.IOException- Throws:
java.io.IOException
-
exportHyperlinks
protected void exportHyperlinks() throws java.io.IOException- Throws:
java.io.IOException
-
exportClickableElements
protected void exportClickableElements() throws java.io.IOException- Throws:
java.io.IOException
-
exportGenericElement
protected void exportGenericElement(JRGenericPrintElement element) throws java.io.IOException
- Throws:
java.io.IOException
-
resolveHyperlinkURL
protected java.lang.String resolveHyperlinkURL(int reportIndex, JRPrintHyperlink link)
-
addHyperlinkData
public void addHyperlinkData(HyperlinkData hyperlinkData)
-
addFontFamily
public void addFontFamily(HtmlFontFamily htmlFontFamily)
-
-