net.sf.jasperreports.engine.xml

## Class JRPrintXmlLoader

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

- All Implemented Interfaces:
    org.xml.sax.ErrorHandler

      public class JRPrintXmlLoader
      extends java.lang.Object
      implements org.xml.sax.ErrorHandler

  Utility class that helps reconverting XML documents into `JasperPrint` objects.

  Generated documents can be stored in XML format if they are exported using the `JRXmlExporter`. After they're exported, one can parse them back into `JasperPrint` objects by using this class.

  Version:
    $Id: JRPrintXmlLoader.java 7017 2014-04-15 10:18:40Z shertage $
  Author:
    Teodor Danciu (teodord@users.sourceforge.net)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static JRSingletonCache<JRSaxParserFactory>` | `printParserFactories`

  - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addError(java.lang.Exception e)`
    `protected void` | `addGenericElementRules(JRXmlDigester digester)`
    `protected void` | `addHyperlinkParameterRules(JRXmlDigester digester)`
    `protected void` | `addValueHandlerRules(JRXmlDigester digester, java.lang.String elementParameterPattern)`
    `protected javax.xml.parsers.SAXParser` | `createParser()`
    `void` | `error(org.xml.sax.SAXParseException e)`
    `void` | `fatalError(org.xml.sax.SAXParseException e)`
    `JasperReportsContext` | `getJasperReportsContext()`
    `static JasperPrint` | `load(java.io.InputStream is)`
    `static JasperPrint` | `load(JasperReportsContext jasperReportsContext, java.io.InputStream is)`
    `static JasperPrint` | `load(java.lang.String sourceFileName)`
    `static JasperPrint` | `loadFromFile(JasperReportsContext jasperReportsContext, java.lang.String sourceFileName)`
    `static JasperPrint` | `loadFromFile(java.lang.String sourceFileName)`
    `protected JRXmlDigester` | `prepareDigester()`
    `void` | `setJasperPrint(JasperPrint jasperPrint)`
    `void` | `warning(org.xml.sax.SAXParseException e)`

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

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

- - ### Field Detail

    - #### printParserFactories

          protected static final JRSingletonCache<JRSaxParserFactory> printParserFactories

  - ### Constructor Detail

    - #### JRPrintXmlLoader

          protected JRPrintXmlLoader()

      Deprecated. Replaced by `JRPrintXmlLoader(JasperReportsContext)`.

    - #### JRPrintXmlLoader

          protected JRPrintXmlLoader(JasperReportsContext jasperReportsContext)

  - ### Method Detail

    - #### getJasperReportsContext

          public JasperReportsContext getJasperReportsContext()

    - #### setJasperPrint

          public void setJasperPrint(JasperPrint jasperPrint)

    - #### loadFromFile

          public static JasperPrint loadFromFile(JasperReportsContext jasperReportsContext,
                                 java.lang.String sourceFileName)
                                          throws JRException

      Throws:
        `JRException`

    - #### loadFromFile

          public static JasperPrint loadFromFile(java.lang.String sourceFileName)
                                          throws JRException

      Throws:
        `JRException`
      See Also:
        `loadFromFile(JasperReportsContext, String)`

    - #### load

          public static JasperPrint load(java.lang.String sourceFileName)
                                  throws JRException

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

    - #### load

          public static JasperPrint load(JasperReportsContext jasperReportsContext,
                         java.io.InputStream is)
                                  throws JRException

      Throws:
        `JRException`

    - #### load

          public static JasperPrint load(java.io.InputStream is)
                                  throws JRException

      Throws:
        `JRException`
      See Also:
        `load(JasperReportsContext, InputStream)`

    - #### prepareDigester

          protected JRXmlDigester prepareDigester()
                                           throws javax.xml.parsers.ParserConfigurationException,
                                                  org.xml.sax.SAXException

      Throws:
        `javax.xml.parsers.ParserConfigurationException`
        `org.xml.sax.SAXException`

    - #### createParser

          protected javax.xml.parsers.SAXParser createParser()

    - #### addHyperlinkParameterRules

          protected void addHyperlinkParameterRules(JRXmlDigester digester)

    - #### addGenericElementRules

          protected void addGenericElementRules(JRXmlDigester digester)

    - #### addValueHandlerRules

          protected void addValueHandlerRules(JRXmlDigester digester,
                                  java.lang.String elementParameterPattern)

    - #### addError

          public void addError(java.lang.Exception e)

    - #### error

          public void error(org.xml.sax.SAXParseException e)

      Specified by:
        `error` in interface `org.xml.sax.ErrorHandler`

    - #### fatalError

          public void fatalError(org.xml.sax.SAXParseException e)

      Specified by:
        `fatalError` in interface `org.xml.sax.ErrorHandler`

    - #### warning

          public void warning(org.xml.sax.SAXParseException e)

      Specified by:
        `warning` in interface `org.xml.sax.ErrorHandler`

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com