Package net.sf.jasperreports.json.export
Class JsonMetadataExporter
- java.lang.Object
-
- net.sf.jasperreports.engine.JRAbstractExporter<JsonMetadataReportConfiguration,JsonExporterConfiguration,WriterExporterOutput,JsonExporterContext>
-
- net.sf.jasperreports.json.export.JsonMetadataExporter
-
- All Implemented Interfaces:
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 class
JsonMetadataExporter.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 String
EXCEPTION_MESSAGE_KEY_INVALID_JSON_OBJECT
protected static String
EXCEPTION_MESSAGE_KEY_INVALID_JSON_OBJECT_ARRAY_FOUND
protected static String
EXCEPTION_MESSAGE_KEY_INVALID_JSON_OBJECT_SEMANTIC
protected DateFormat
isoDateFormat
static String
JSON_EXPORTER_BOOLEAN_PROPERTIES_PREFIX
static String
JSON_EXPORTER_DATA_PROPERTY
static String
JSON_EXPORTER_DATE_PROPERTIES_PREFIX
static String
JSON_EXPORTER_KEY
static String
JSON_EXPORTER_NUMBER_PROPERTIES_PREFIX
static String
JSON_EXPORTER_PATH_PROPERTY
protected static String
JSON_EXPORTER_PROPERTIES_PREFIX
static String
JSON_EXPORTER_REPEAT_PROPERTIES_PREFIX
static String
JSON_EXPORTER_REPEAT_VALUE_PROPERTY
static String
JSON_EXPORTER_STRING_PROPERTIES_PREFIX
protected int
pageIndex
protected int
reportIndex
protected Writer
writer
-
Fields inherited from class net.sf.jasperreports.engine.JRAbstractExporter
allSelector, crtCompositeConfiguration, crtCompositeItemConfiguration, crtItem, dateFormatCache, EXCEPTION_MESSAGE_KEY_EMPTY_INPUT_SOURCE_IN_BATCH_MODE, EXCEPTION_MESSAGE_KEY_END_PAGE_INDEX_OUT_OF_RANGE, EXCEPTION_MESSAGE_KEY_INVALID_IMAGE_NAME, EXCEPTION_MESSAGE_KEY_INVALID_ZOOM_RATIO, EXCEPTION_MESSAGE_KEY_NO_INPUT_SOURCE, EXCEPTION_MESSAGE_KEY_NO_OUTPUT_SPECIFIED, 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, 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 void
exportElement(JRPrintElement element)
protected void
exportElements(Collection<JRPrintElement> elements)
protected void
exportPage(JRPrintPage page)
void
exportReport()
Performs the export.protected void
exportReportToWriter()
protected Class<JsonExporterConfiguration>
getConfigurationInterface()
String
getExporterKey()
String
getExporterPropertiesPrefix()
Returns the properties prefix for the current exporter.protected Class<JsonMetadataReportConfiguration>
getItemConfigurationInterface()
protected JRStyledText
getStyledText(JRPrintText textElement)
protected void
initExport()
protected void
initReport()
void
validateSchema(String jsonSchema)
-
Methods inherited from class net.sf.jasperreports.engine.JRAbstractExporter
checkInterrupted, createFilter, defaultParseNumber, ensureInput, ensureJasperReportsContext, ensureOutput, getBooleanCellValue, getCurrentConfiguration, getCurrentItemConfiguration, getCurrentJasperPrint, getDateCellValue, getDateFormat, getExporterConfiguration, getExporterContext, getExporterInput, getExporterOutput, getHyperlinkProducer, getJasperReportsContext, getLocale, getNumberCellValue, getNumberFormat, getOffsetX, getOffsetY, getPageRange, getPropertiesUtil, getRendererUtil, getReportContext, getReportExportConfiguration, getRepository, getStyledText, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, insideFrame, reset, resetExportContext, restoreElementOffsets, setConfiguration, setConfiguration, setCurrentExporterInputItem, setExporterInput, setExporterOutput, setFrameElementsOffset, setJasperReportsContext, setOffset, setOffset, 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()
-
getExporterKey
public String getExporterKey()
- Specified by:
getExporterKey
in classJRAbstractExporter<JsonMetadataReportConfiguration,JsonExporterConfiguration,WriterExporterOutput,JsonExporterContext>
-
getExporterPropertiesPrefix
public String getExporterPropertiesPrefix()
Description copied from class:JRAbstractExporter
Returns the properties prefix for the current exporter.- Specified by:
getExporterPropertiesPrefix
in classJRAbstractExporter<JsonMetadataReportConfiguration,JsonExporterConfiguration,WriterExporterOutput,JsonExporterContext>
- Returns:
- the properties prefix for the current exporter
-
exportReport
public void exportReport() throws JRException
Description copied from interface:Exporter
Performs the export.- Specified by:
exportReport
in interfaceExporter<ExporterInput,JsonMetadataReportConfiguration,JsonExporterConfiguration,WriterExporterOutput>
- Specified by:
exportReport
in classJRAbstractExporter<JsonMetadataReportConfiguration,JsonExporterConfiguration,WriterExporterOutput,JsonExporterContext>
- Throws:
JRException
-
initExport
protected void initExport()
-
initReport
protected void initReport()
-
exportReportToWriter
protected void exportReportToWriter() throws JRException, IOException
- Throws:
JRException
IOException
-
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)
-
-