Package net.sf.jasperreports.engine.xml
Class JRPrintXmlLoader
- java.lang.Object
-
- net.sf.jasperreports.engine.xml.JRPrintXmlLoader
-
- All Implemented Interfaces:
ErrorHandler
public class JRPrintXmlLoader extends Object implements ErrorHandler
Utility class that helps reconverting XML documents intoJasperPrintobjects.Generated documents can be stored in XML format if they are exported using the
JRXmlExporter. After they're exported, one can parse them back intoJasperPrintobjects by using this class.- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedJRPrintXmlLoader(JasperReportsContext jasperReportsContext)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddError(Exception e)protected voidaddGenericElementRules(JRXmlDigester digester)protected voidaddHyperlinkParameterRules(JRXmlDigester digester)protected voidaddValueHandlerRules(JRXmlDigester digester, String elementParameterPattern)protected SAXParsercreateParser()voiderror(SAXParseException e)voidfatalError(SAXParseException e)JasperReportsContextgetJasperReportsContext()static JasperPrintload(InputStream is)static JasperPrintload(String sourceFileName)static JasperPrintload(JasperReportsContext jasperReportsContext, InputStream is)static JasperPrintloadFromFile(String sourceFileName)static JasperPrintloadFromFile(JasperReportsContext jasperReportsContext, String sourceFileName)protected JRXmlDigesterprepareDigester()voidsetJasperPrint(JasperPrint jasperPrint)voidwarning(SAXParseException e)
-
-
-
Constructor Detail
-
JRPrintXmlLoader
protected JRPrintXmlLoader(JasperReportsContext jasperReportsContext)
-
-
Method Detail
-
getJasperReportsContext
public JasperReportsContext getJasperReportsContext()
-
setJasperPrint
public void setJasperPrint(JasperPrint jasperPrint)
-
loadFromFile
public static JasperPrint loadFromFile(JasperReportsContext jasperReportsContext, String sourceFileName) throws JRException
- Throws:
JRException
-
loadFromFile
public static JasperPrint loadFromFile(String sourceFileName) throws JRException
- Throws:
JRException- See Also:
loadFromFile(JasperReportsContext, String)
-
load
public static JasperPrint load(String sourceFileName) throws JRException
- Throws:
JRException- See Also:
loadFromFile(String)
-
load
public static JasperPrint load(JasperReportsContext jasperReportsContext, InputStream is) throws JRException
- Throws:
JRException
-
load
public static JasperPrint load(InputStream is) throws JRException
- Throws:
JRException- See Also:
load(JasperReportsContext, InputStream)
-
prepareDigester
protected JRXmlDigester prepareDigester() throws ParserConfigurationException, SAXException
-
createParser
protected SAXParser createParser()
-
addHyperlinkParameterRules
protected void addHyperlinkParameterRules(JRXmlDigester digester)
-
addGenericElementRules
protected void addGenericElementRules(JRXmlDigester digester)
-
addValueHandlerRules
protected void addValueHandlerRules(JRXmlDigester digester, String elementParameterPattern)
-
addError
public void addError(Exception e)
-
error
public void error(SAXParseException e)
- Specified by:
errorin interfaceErrorHandler
-
fatalError
public void fatalError(SAXParseException e)
- Specified by:
fatalErrorin interfaceErrorHandler
-
warning
public void warning(SAXParseException e)
- Specified by:
warningin interfaceErrorHandler
-
-