Package net.sf.jasperreports.engine.xml
Class JRXmlTemplateLoader
- java.lang.Object
-
- net.sf.jasperreports.engine.xml.JRXmlTemplateLoader
-
-
Field Summary
Fields Modifier and Type Field Description static String
EXCEPTION_MESSAGE_KEY_TEMPLATE_NOT_FOUND
static String
EXCEPTION_MESSAGE_KEY_TEMPLATE_PARSING_ERROR
static String
EXCEPTION_MESSAGE_KEY_TEMPLATE_READING_ERROR
static String
EXCEPTION_MESSAGE_KEY_URL_CONNECTION_ERROR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JRXmlTemplateLoader
getInstance(JasperReportsContext jasperReportsContext)
static JRXmlTemplateLoader
getInstance(RepositoryContext repositoryContext)
static JRTemplate
load(File file)
static JRTemplate
load(InputStream data)
static JRTemplate
load(String location)
static JRTemplate
load(URL url)
JRTemplate
loadTemplate(File file)
Parses a template XML file into atemplate object
.JRTemplate
loadTemplate(InputStream data)
Parses a template XML data stream into atemplate object
.JRTemplate
loadTemplate(String location)
Parses a template XML found at a specified location into atemplate object
.JRTemplate
loadTemplate(URL url)
Parses a template XML located at a URL into atemplate object
.
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_TEMPLATE_NOT_FOUND
public static final String EXCEPTION_MESSAGE_KEY_TEMPLATE_NOT_FOUND
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_TEMPLATE_PARSING_ERROR
public static final String EXCEPTION_MESSAGE_KEY_TEMPLATE_PARSING_ERROR
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_TEMPLATE_READING_ERROR
public static final String EXCEPTION_MESSAGE_KEY_TEMPLATE_READING_ERROR
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_URL_CONNECTION_ERROR
public static final String EXCEPTION_MESSAGE_KEY_URL_CONNECTION_ERROR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static JRXmlTemplateLoader getInstance(JasperReportsContext jasperReportsContext)
-
getInstance
public static JRXmlTemplateLoader getInstance(RepositoryContext repositoryContext)
-
loadTemplate
public JRTemplate loadTemplate(String location) throws JRException
Parses a template XML found at a specified location into atemplate object
.- Parameters:
location
- the template XML location. Can be a URL, a file path or a classloader resource name.- Returns:
- the template object
- Throws:
JRException
- when the location cannot be resolved or read- See Also:
RepositoryUtil.getBytesFromLocation(String)
-
loadTemplate
public JRTemplate loadTemplate(File file)
Parses a template XML file into atemplate object
.- Parameters:
file
- the template XML file- Returns:
- the template object
-
loadTemplate
public JRTemplate loadTemplate(URL url)
Parses a template XML located at a URL into atemplate object
.- Parameters:
url
- the location of the template XML- Returns:
- the template object
-
loadTemplate
public JRTemplate loadTemplate(InputStream data)
Parses a template XML data stream into atemplate object
.- Parameters:
data
- the data stream- Returns:
- the template object
-
load
public static JRTemplate load(String location) throws JRException
- Throws:
JRException
- See Also:
loadTemplate(String)
-
load
public static JRTemplate load(File file)
- See Also:
loadTemplate(File)
-
load
public static JRTemplate load(URL url)
- See Also:
loadTemplate(URL)
-
load
public static JRTemplate load(InputStream data)
- See Also:
loadTemplate(InputStream)
-
-