net.sf.jasperreports.engine.xml

## Class JRXmlTemplateLoader

- java.lang.Object
- - net.sf.jasperreports.engine.xml.JRXmlTemplateLoader

-     public class JRXmlTemplateLoader
      extends java.lang.Object

  Utility class that loads `templates` from XML representations.
  Version:
    $Id: JRXmlTemplateLoader.java 6928 2014-02-25 15:41:21Z teodord $
  Author:
    Lucian Chirita (lucianc@users.sourceforge.net)

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `JRXmlTemplateLoader()` Deprecated. Replaced by `JRXmlTemplateLoader(JasperReportsContext)`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static JRXmlTemplateLoader` | `getInstance(JasperReportsContext jasperReportsContext)`
    `static JRTemplate` | `load(java.io.File file)`
    `static JRTemplate` | `load(java.io.InputStream data)`
    `static JRTemplate` | `load(java.lang.String location)`
    `static JRTemplate` | `load(java.net.URL url)`
    `JRTemplate` | `loadTemplate(java.io.File file)` Parses a template XML file into a `template object`.
    `JRTemplate` | `loadTemplate(java.io.InputStream data)` Parses a template XML data stream into a `template object`.
    `JRTemplate` | `loadTemplate(java.lang.String location)` Parses a template XML found at a specified location into a `template object`.
    `JRTemplate` | `loadTemplate(java.net.URL url)` Parses a template XML located at a URL into a `template object`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JRXmlTemplateLoader

          protected JRXmlTemplateLoader()

      Deprecated. Replaced by `JRXmlTemplateLoader(JasperReportsContext)`.

  - ### Method Detail

    - #### getInstance

          public static JRXmlTemplateLoader getInstance(JasperReportsContext jasperReportsContext)

    - #### loadTemplate

          public JRTemplate loadTemplate(java.lang.String location)
                                  throws JRException

      Parses a template XML found at a specified location into a `template 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(java.io.File file)

      Parses a template XML file into a `template object`.
      Parameters:
        `file` - the template XML file
      Returns:
        the template object

    - #### loadTemplate

          public JRTemplate loadTemplate(java.net.URL url)

      Parses a template XML located at a URL into a `template object`.
      Parameters:
        `url` - the location of the template XML
      Returns:
        the template object

    - #### loadTemplate

          public JRTemplate loadTemplate(java.io.InputStream data)

      Parses a template XML data stream into a `template object`.
      Parameters:
        `data` - the data stream
      Returns:
        the template object

    - #### load

          public static JRTemplate load(java.lang.String location)
                                 throws JRException

      Throws:
        `JRException`
      See Also:
        `loadTemplate(String)`

    - #### load

          public static JRTemplate load(java.io.File file)

      See Also:
        `loadTemplate(File)`

    - #### load

          public static JRTemplate load(java.net.URL url)

      See Also:
        `loadTemplate(URL)`

    - #### load

          public static JRTemplate load(java.io.InputStream data)

      See Also:
        `loadTemplate(InputStream)`

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com