net.sf.jasperreports.engine.export
Class JRXmlExporter
java.lang.Object
net.sf.jasperreports.engine.JRAbstractExporter
net.sf.jasperreports.engine.export.JRXmlExporter
- All Implemented Interfaces:
- JRExporter
- Direct Known Subclasses:
- JRXml4SwfExporter
public class JRXmlExporter
- extends JRAbstractExporter
Exports a JasperReports document to an XML file that contains the same data as a JasperPrint
object, but in XML format, instead of a serialized class. Such XML files can be parsed back into JasperPrint
object using the JRPrintXmlLoader utility class. Their structure is validated
against an internal XSD file called jasperprint.xsd.
- Version:
- $Id: JRXmlExporter.java 5180 2012-03-29 13:23:12Z teodord $
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
| Fields inherited from class net.sf.jasperreports.engine.JRAbstractExporter |
dateFormatCache, endPageIndex, filter, fontMap, globalOffsetX, globalOffsetY, hyperlinkProducerFactory, isModeBatch, jasperPrint, jasperPrintList, jasperReportsContext, numberFormatCache, parameters, PROPERTY_DEFAULT_FILTER_FACTORY, PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY, startPageIndex |
| Methods inherited from class net.sf.jasperreports.engine.JRAbstractExporter |
createFilter, defaultParseNumber, getBooleanCellValue, getBooleanParameter, getCharacterParameter, getCustomHandler, getDateCellValue, getDateFormat, getFloatParameter, getHyperlinkProducer, getIntegerParameter, getJasperReportsContext, getLocale, getNumberCellValue, getNumberFormat, getOffsetX, getOffsetY, getParameter, getParameterResolver, getParameters, getPropertiesUtil, getReportContext, getStringArrayParameter, getStringParameter, getStringParameterOrDefault, getStyledText, getStyledText, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, reset, resetClassLoader, resetExportContext, restoreElementOffsets, setClassLoader, setExportContext, setFontMap, setFrameElementsOffset, setInput, setJasperPrint, setOffset, setOffset, setOutput, setPageRange, setParameter, setParameters, setReportContext |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XML_EXPORTER_KEY
public static final String XML_EXPORTER_KEY
- The exporter key, as used in
GenericElementHandlerEnviroment.getHandler(net.sf.jasperreports.engine.JRGenericElementType, String).
- See Also:
- Constant Field Values
DEFAULT_XML_ENCODING
protected static final String DEFAULT_XML_ENCODING
- See Also:
- Constant Field Values
DEFAULT_OBJECT_TYPE
protected static final String DEFAULT_OBJECT_TYPE
- See Also:
- Constant Field Values
XML_FILES_SUFFIX
protected static final String XML_FILES_SUFFIX
- See Also:
- Constant Field Values
IMAGE_PREFIX
protected static final String IMAGE_PREFIX
- See Also:
- Constant Field Values
JASPERPRINT_NAMESPACE
public static final XmlNamespace JASPERPRINT_NAMESPACE
xmlWriter
protected JRXmlWriteHelper xmlWriter
encoding
protected String encoding
progressMonitor
protected JRExportProgressMonitor progressMonitor
rendererToImagePathMap
protected Map<Renderable,String> rendererToImagePathMap
imageNameToImageDataMap
protected Map<String,byte[]> imageNameToImageDataMap
stylesMap
protected Map<String,JRStyle> stylesMap
isEmbeddingImages
protected boolean isEmbeddingImages
destFile
protected File destFile
imagesDir
protected File imagesDir
exporterContext
protected JRXmlExporterContext exporterContext
JRXmlExporter
public JRXmlExporter()
- See Also:
JRXmlExporter(JasperReportsContext)
JRXmlExporter
public JRXmlExporter(JasperReportsContext jasperReportsContext)
exportReport
public void exportReport()
throws JRException
- Description copied from interface:
JRExporter
- Actually starts the export process.
- Specified by:
exportReport in interface JRExporter- Specified by:
exportReport in class JRAbstractExporter
- Throws:
JRException
setHyperlinkProducerFactory
protected void setHyperlinkProducerFactory()
- Overrides:
setHyperlinkProducerFactory in class JRAbstractExporter
exportReportToFile
protected void exportReportToFile()
throws JRException
- Throws:
JRException
exportReportToBuffer
protected StringBuffer exportReportToBuffer()
throws JRException
- Throws:
JRException
getNamespace
protected XmlNamespace getNamespace()
exportReportToStream
protected void exportReportToStream(Writer writer)
throws JRException,
IOException
- Throws:
JRException
IOException
exportProperties
protected void exportProperties(JRPropertiesHolder propertiesHolder)
throws IOException
- Throws:
IOException
exportStyle
protected void exportStyle(JRStyle style)
throws IOException
- Throws:
IOException
exportOrigin
protected void exportOrigin(JROrigin origin)
throws IOException
- Throws:
IOException
exportPage
protected void exportPage(JRPrintPage page)
throws JRException,
IOException
- Throws:
IOException
JRException
exportElements
protected void exportElements(Collection<JRPrintElement> elements)
throws IOException,
JRException
- Throws:
IOException
JRException
exportElement
public void exportElement(JRPrintElement element)
throws IOException,
JRException
- Throws:
IOException
JRException
exportLine
protected void exportLine(JRPrintLine line)
throws IOException
- Throws:
IOException
exportReportElement
protected void exportReportElement(JRPrintElement element)
throws IOException
- Throws:
IOException
exportGraphicElement
protected void exportGraphicElement(JRPrintGraphicElement element)
throws IOException
- Throws:
IOException
exportPen
protected void exportPen(JRPen pen)
throws IOException
- Throws:
IOException
exportPen
protected void exportPen(String element,
JRPen pen)
throws IOException
- Throws:
IOException
exportRectangle
protected void exportRectangle(JRPrintRectangle rectangle)
throws IOException
- Throws:
IOException
exportEllipse
protected void exportEllipse(JRPrintEllipse ellipse)
throws IOException
- Throws:
IOException
exportImage
public void exportImage(JRPrintImage image)
throws JRException,
IOException
- Throws:
JRException
IOException
exportText
public void exportText(JRPrintText text)
throws IOException
- Throws:
IOException
formatTextLineBreakOffsets
protected StringBuffer formatTextLineBreakOffsets(short[] lineBreakOffsets)
exportTabStop
public void exportTabStop(TabStop tabStop)
throws IOException
- Throws:
IOException
exportFont
protected void exportFont(JRFont font)
throws IOException
- Throws:
IOException
exportFrame
protected void exportFrame(JRPrintFrame frame)
throws IOException,
JRException
- Throws:
IOException
JRException
exportHyperlinkParameters
protected void exportHyperlinkParameters(JRPrintHyperlink hyperlink)
throws IOException
- Throws:
IOException
exportHyperlinkParameter
protected void exportHyperlinkParameter(JRPrintHyperlinkParameter parameter)
throws IOException
- Throws:
IOException
exportGenericElement
protected void exportGenericElement(JRGenericPrintElement element)
throws IOException
- Throws:
IOException
getExporterPropertiesPrefix
protected String getExporterPropertiesPrefix()
getExporterKey
protected String getExporterKey()
- Specified by:
getExporterKey in class JRAbstractExporter
getXmlWriteHelper
public JRXmlWriteHelper getXmlWriteHelper()
- Returns the XML write helper used by this exporter.
The helper can be used to output XML elements and attributes.
- Returns:
- the XML write helper used by this exporter
Copyright © 2012. All Rights Reserved.