net.sf.jasperreports.engine.xml

## Class JRXmlLoader

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

-     public class JRXmlLoader
      extends java.lang.Object

  Utility class that helps parsing a JRXML file into a `JasperDesign` object.

  This can be done using one of the `load(...)` or `loadXml` 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.

  Version:
    $Id: JRXmlLoader.java 7025 2014-04-17 07:55:02Z shertage $
  Author:
    Teodor Danciu (teodord@users.sourceforge.net)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JRXmlLoader(org.apache.commons.digester.Digester digester)` Deprecated. Replaced by `JRXmlLoader(JasperReportsContext, Digester)`.
    `JRXmlLoader(JasperReportsContext jasperReportsContext, org.apache.commons.digester.Digester digester)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addError(java.lang.Exception e)`
    `void` | `addGroupEvaluatedChart(JRDesignChart chart)`
    `void` | `addGroupEvaluatedImage(JRDesignImage image)`
    `void` | `addGroupEvaluatedTextField(JRDesignTextField textField)`
    `void` | `addGroupReference(XmlGroupReference reference)`
    `void` | `addGroupReprintedElement(JRDesignElement element)`
    `java.util.Set<JRElementDataset>` | `getGroupBoundDatasets()`
    `JasperReportsContext` | `getJasperReportsContext()`
    `XmlLoaderReportContext` | `getReportContext()`
    `boolean` | `isIgnoreConsistencyProblems()` Returns true if the loader is set to ignore consistency problems
    `static JasperDesign` | `load(java.io.File file)`
    `static JasperDesign` | `load(java.io.InputStream is)`
    `static JasperDesign` | `load(JasperReportsContext jasperReportsContext, java.io.File file)`
    `static JasperDesign` | `load(JasperReportsContext jasperReportsContext, java.io.InputStream is)`
    `static JasperDesign` | `load(JasperReportsContext jasperReportsContext, java.lang.String sourceFileName)`
    `static JasperDesign` | `load(java.lang.String sourceFileName)`
    `JasperDesign` | `loadXML(org.xml.sax.InputSource is)`
    `JasperDesign` | `loadXML(java.io.InputStream is)`
    `XmlLoaderReportContext` | `popReportContext()`
    `void` | `pushReportContext(XmlLoaderReportContext context)`
    `protected JRGroup` | `resolveGroup(java.lang.String groupName, XmlLoaderReportContext context)`
    `void` | `setIgnoreConsistencyProblems(boolean ignoreConsistencyProblems)` Allows to enable or disable the reporting of consistency problems.
    `void` | `setJasperDesign(JasperDesign jasperDesign)`

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

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

- - ### Constructor Detail

    - #### JRXmlLoader

          public JRXmlLoader(org.apache.commons.digester.Digester digester)

      Deprecated. Replaced by `JRXmlLoader(JasperReportsContext, Digester)`.

    - #### JRXmlLoader

          public JRXmlLoader(JasperReportsContext jasperReportsContext,
                     org.apache.commons.digester.Digester digester)

  - ### Method Detail

    - #### getJasperReportsContext

          public JasperReportsContext getJasperReportsContext()

    - #### setJasperDesign

          public void setJasperDesign(JasperDesign jasperDesign)

    - #### addGroupReference

          public void addGroupReference(XmlGroupReference reference)

    - #### addGroupReprintedElement

          public void addGroupReprintedElement(JRDesignElement element)

    - #### addGroupEvaluatedImage

          public void addGroupEvaluatedImage(JRDesignImage image)

    - #### addGroupEvaluatedTextField

          public void addGroupEvaluatedTextField(JRDesignTextField textField)

    - #### addGroupEvaluatedChart

          public void addGroupEvaluatedChart(JRDesignChart chart)

    - #### getGroupBoundDatasets

          public java.util.Set<JRElementDataset> getGroupBoundDatasets()

    - #### load

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

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

    - #### load

          public static JasperDesign load(JasperReportsContext jasperReportsContext,
                          java.lang.String sourceFileName)
                                   throws JRException

      Throws:
        `JRException`

    - #### load

          public static JasperDesign load(java.io.File file)
                                   throws JRException

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

    - #### load

          public static JasperDesign load(JasperReportsContext jasperReportsContext,
                          java.io.File file)
                                   throws JRException

      Throws:
        `JRException`

    - #### load

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

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

    - #### load

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

      Throws:
        `JRException`

    - #### loadXML

          public JasperDesign loadXML(java.io.InputStream is)
                               throws JRException

      Throws:
        `JRException`

    - #### loadXML

          public JasperDesign loadXML(org.xml.sax.InputSource is)
                               throws JRException

      Throws:
        `JRException`

    - #### resolveGroup

          protected JRGroup resolveGroup(java.lang.String groupName,
                             XmlLoaderReportContext context)

    - #### addError

          public void addError(java.lang.Exception e)

    - #### 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.

    - #### pushReportContext

          public void pushReportContext(XmlLoaderReportContext context)

    - #### popReportContext

          public XmlLoaderReportContext popReportContext()

    - #### getReportContext

          public XmlLoaderReportContext getReportContext()

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com