Class JsonMetadataExporter
- java.lang.Object
-
- net.sf.jasperreports.engine.JRAbstractExporter<JsonMetadataReportConfiguration,JsonExporterConfiguration,WriterExporterOutput,JsonExporterContext>
-
- net.sf.jasperreports.engine.export.JsonMetadataExporter
-
- All Implemented Interfaces:
JRExporter<ExporterInput,JsonMetadataReportConfiguration,JsonExporterConfiguration,WriterExporterOutput>,Exporter<ExporterInput,JsonMetadataReportConfiguration,JsonExporterConfiguration,WriterExporterOutput>
public class JsonMetadataExporter extends JRAbstractExporter<JsonMetadataReportConfiguration,JsonExporterConfiguration,WriterExporterOutput,JsonExporterContext>
- Author:
- Narcis Marcu (narcism@users.sourceforge.net)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classJsonMetadataExporter.ExporterContext-
Nested classes/interfaces inherited from class net.sf.jasperreports.engine.JRAbstractExporter
JRAbstractExporter.BaseExporterContext, JRAbstractExporter.PageRange
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringEXCEPTION_MESSAGE_KEY_INVALID_JSON_OBJECTprotected static StringEXCEPTION_MESSAGE_KEY_INVALID_JSON_OBJECT_ARRAY_FOUNDprotected static StringEXCEPTION_MESSAGE_KEY_INVALID_JSON_OBJECT_SEMANTICprotected DateFormatisoDateFormatstatic StringJSON_EXPORTER_BOOLEAN_PROPERTIES_PREFIXstatic StringJSON_EXPORTER_DATA_PROPERTYstatic StringJSON_EXPORTER_DATE_PROPERTIES_PREFIXstatic StringJSON_EXPORTER_KEYstatic StringJSON_EXPORTER_NUMBER_PROPERTIES_PREFIXstatic StringJSON_EXPORTER_PATH_PROPERTYprotected static StringJSON_EXPORTER_PROPERTIES_PREFIXstatic StringJSON_EXPORTER_REPEAT_PROPERTIES_PREFIXstatic StringJSON_EXPORTER_REPEAT_VALUE_PROPERTYstatic StringJSON_EXPORTER_STRING_PROPERTIES_PREFIXprotected intpageIndexprotected intreportIndexprotected 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 JsonMetadataExporter()JsonMetadataExporter(JasperReportsContext jasperReportsContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidensureOutput()protected voidexportElement(JRPrintElement element)protected voidexportElements(Collection<JRPrintElement> elements)protected voidexportPage(JRPrintPage page)voidexportReport()Performs the export.protected voidexportReportToWriter()protected Class<JsonExporterConfiguration>getConfigurationInterface()StringgetExporterKey()StringgetExporterPropertiesPrefix()Returns the properties prefix for the current exporter.protected Class<JsonMetadataReportConfiguration>getItemConfigurationInterface()protected JRStyledTextgetStyledText(JRPrintText textElement)protected voidinitExport()protected voidinitReport()voidvalidateSchema(String jsonSchema)-
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, 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
-
JSON_EXPORTER_KEY
public static final String JSON_EXPORTER_KEY
- See Also:
- Constant Field Values
-
JSON_EXPORTER_PROPERTIES_PREFIX
protected static final String JSON_EXPORTER_PROPERTIES_PREFIX
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_INVALID_JSON_OBJECT
protected static final String EXCEPTION_MESSAGE_KEY_INVALID_JSON_OBJECT
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_INVALID_JSON_OBJECT_SEMANTIC
protected static final String EXCEPTION_MESSAGE_KEY_INVALID_JSON_OBJECT_SEMANTIC
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_INVALID_JSON_OBJECT_ARRAY_FOUND
protected static final String EXCEPTION_MESSAGE_KEY_INVALID_JSON_OBJECT_ARRAY_FOUND
- See Also:
- Constant Field Values
-
JSON_EXPORTER_PATH_PROPERTY
public static final String JSON_EXPORTER_PATH_PROPERTY
- See Also:
- Constant Field Values
-
JSON_EXPORTER_REPEAT_VALUE_PROPERTY
public static final String JSON_EXPORTER_REPEAT_VALUE_PROPERTY
- See Also:
- Constant Field Values
-
JSON_EXPORTER_DATA_PROPERTY
public static final String JSON_EXPORTER_DATA_PROPERTY
- See Also:
- Constant Field Values
-
JSON_EXPORTER_REPEAT_PROPERTIES_PREFIX
public static final String JSON_EXPORTER_REPEAT_PROPERTIES_PREFIX
- See Also:
- Constant Field Values
-
JSON_EXPORTER_NUMBER_PROPERTIES_PREFIX
public static final String JSON_EXPORTER_NUMBER_PROPERTIES_PREFIX
- See Also:
- Constant Field Values
-
JSON_EXPORTER_DATE_PROPERTIES_PREFIX
public static final String JSON_EXPORTER_DATE_PROPERTIES_PREFIX
- See Also:
- Constant Field Values
-
JSON_EXPORTER_BOOLEAN_PROPERTIES_PREFIX
public static final String JSON_EXPORTER_BOOLEAN_PROPERTIES_PREFIX
- See Also:
- Constant Field Values
-
JSON_EXPORTER_STRING_PROPERTIES_PREFIX
public static final String JSON_EXPORTER_STRING_PROPERTIES_PREFIX
- See Also:
- Constant Field Values
-
isoDateFormat
protected final DateFormat isoDateFormat
-
writer
protected Writer writer
-
reportIndex
protected int reportIndex
-
pageIndex
protected int pageIndex
-
-
Constructor Detail
-
JsonMetadataExporter
public JsonMetadataExporter()
-
JsonMetadataExporter
public JsonMetadataExporter(JasperReportsContext jasperReportsContext)
-
-
Method Detail
-
validateSchema
public void validateSchema(String jsonSchema) throws JRException
- Throws:
JRException
-
getConfigurationInterface
protected Class<JsonExporterConfiguration> getConfigurationInterface()
-
getItemConfigurationInterface
protected Class<JsonMetadataReportConfiguration> getItemConfigurationInterface()
-
ensureOutput
protected void ensureOutput()
- Specified by:
ensureOutputin classJRAbstractExporter<JsonMetadataReportConfiguration,JsonExporterConfiguration,WriterExporterOutput,JsonExporterContext>
-
getExporterKey
public String getExporterKey()
- Specified by:
getExporterKeyin classJRAbstractExporter<JsonMetadataReportConfiguration,JsonExporterConfiguration,WriterExporterOutput,JsonExporterContext>
-
getExporterPropertiesPrefix
public String getExporterPropertiesPrefix()
Description copied from class:JRAbstractExporterReturns the properties prefix for the current exporter.- Specified by:
getExporterPropertiesPrefixin classJRAbstractExporter<JsonMetadataReportConfiguration,JsonExporterConfiguration,WriterExporterOutput,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,JsonMetadataReportConfiguration,JsonExporterConfiguration,WriterExporterOutput>- Specified by:
exportReportin classJRAbstractExporter<JsonMetadataReportConfiguration,JsonExporterConfiguration,WriterExporterOutput,JsonExporterContext>- Throws:
JRException
-
initExport
protected void initExport()
-
initReport
protected void initReport()
-
exportReportToWriter
protected void exportReportToWriter() throws JRException, IOException- Throws:
JRExceptionIOException
-
exportPage
protected void exportPage(JRPrintPage page) throws IOException, ExportInterruptedException
-
exportElements
protected void exportElements(Collection<JRPrintElement> elements) throws IOException, ExportInterruptedException
-
exportElement
protected void exportElement(JRPrintElement element) throws IOException
- Throws:
IOException
-
getStyledText
protected JRStyledText getStyledText(JRPrintText textElement)
-
-