Package net.sf.jasperreports.engine.xml
Class JRXmlLoader
- java.lang.Object
-
- net.sf.jasperreports.engine.xml.JRXmlLoader
-
public class JRXmlLoader extends Object
Utility class that helps parsing a JRXML file into aJasperDesign
object.This can be done using one of the
load(...)
orloadXml
methods published by this class. Applications might need to do this in cases where report templates kept in their source form (JRXML) must be modified at runtime based on some user input and then compiled on the fly for filling with data.- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static String
EXCEPTION_MESSAGE_KEY_NO_LOADER
-
Constructor Summary
Constructors Constructor Description JRXmlLoader(JasperReportsContext jasperReportsContext)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JasperReportsContext
getJasperReportsContext()
boolean
isIgnoreConsistencyProblems()
Returns true if the loader is set to ignore consistency problemsstatic JasperDesign
load(File file)
static JasperDesign
load(InputStream is)
static JasperDesign
load(String sourceFileName)
static JasperDesign
load(JasperReportsContext jasperReportsContext, File file)
static JasperDesign
load(JasperReportsContext jasperReportsContext, InputStream is)
static JasperDesign
load(JasperReportsContext jasperReportsContext, String sourceFileName)
JasperDesign
loadXML(InputStream is)
void
setIgnoreConsistencyProblems(boolean ignoreConsistencyProblems)
Allows to enable or disable the reporting of consistency problems.
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_NO_LOADER
public static final String EXCEPTION_MESSAGE_KEY_NO_LOADER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JRXmlLoader
public JRXmlLoader(JasperReportsContext jasperReportsContext)
-
-
Method Detail
-
getJasperReportsContext
public JasperReportsContext getJasperReportsContext()
-
load
public static JasperDesign load(String sourceFileName) throws JRException
- Throws:
JRException
- See Also:
load(JasperReportsContext, String)
-
load
public static JasperDesign load(JasperReportsContext jasperReportsContext, String sourceFileName) throws JRException
- Throws:
JRException
-
load
public static JasperDesign load(File file) throws JRException
- Throws:
JRException
- See Also:
load(JasperReportsContext, File)
-
load
public static JasperDesign load(JasperReportsContext jasperReportsContext, File file) throws JRException
- Throws:
JRException
-
load
public static JasperDesign load(InputStream is) throws JRException
- Throws:
JRException
- See Also:
load(JasperReportsContext, InputStream)
-
load
public static JasperDesign load(JasperReportsContext jasperReportsContext, InputStream is) throws JRException
- Throws:
JRException
-
loadXML
public JasperDesign loadXML(InputStream is) throws JRException
- Throws:
JRException
-
isIgnoreConsistencyProblems
public boolean isIgnoreConsistencyProblems()
Returns true if the loader is set to ignore consistency problems- Returns:
- the ignoreConsistencyProblems flag.
-
setIgnoreConsistencyProblems
public void setIgnoreConsistencyProblems(boolean ignoreConsistencyProblems)
Allows to enable or disable the reporting of consistency problems. Consistency problems are problems in the logical structure of the report such as references to missing groups and fonts.- Parameters:
ignoreConsistencyProblems
- The ignoreConsistencyProblems value to set.
-
-