com.ibm.as400.util.reportwriter.processor
Class XSLReportProcessor

java.lang.Object
  |
  +--com.ibm.as400.util.reportwriter.processor.ReportProcessor
        |
        +--com.ibm.as400.util.reportwriter.processor.XSLReportProcessor

public class XSLReportProcessor
extends ReportProcessor
implements java.io.Serializable

The XSLReportProcessor class is used to merge XML source data together with an XSL stylesheet (consisting of a formatting object templates) to create and then process a report consisting of formatting objects conforming to the Extensible Stylesheet Language Specification. The report data is converted to a user specified output data stream format. The output data stream format and output destination information are retrieved from the OutputGenerator associated with an instance of this class. Both the OutputGenerator and Source must be speicified before any pages of the report can be generated.

See Also:
Serialized Form

Fields inherited from class com.ibm.as400.util.reportwriter.processor.ReportProcessor
ALL, context_, RANGE
 
Constructor Summary
XSLReportProcessor()
          Constructs an XSLReportProcessor object.
XSLReportProcessor(com.ibm.as400.util.reportwriter.processor.Context context)
          Constructs an XSLReportProcessor object.
 
Method Summary
 void processReport()
          Processes the report.
 void setTemplate(org.w3c.dom.Document xslSource, java.lang.String styleBaseURL)
          Sets the formatting template as the specified XSL document, using the specified XSL stylesheet base URL.
 void setTemplate(java.io.InputStream xslSource, java.lang.String styleBaseURL)
          Sets the formatting template as the specified byte-stream reader, using the specified XSL stylesheet base URL.
 void setTemplate(java.io.Reader xslSource, java.lang.String styleBaseURL)
          Sets the formatting template as the specified character-stream reader, using the specified XSL stylesheet base URL.
 void setTemplate(java.lang.String xslSource, java.lang.String styleBaseURL)
          Sets the formatting template as the specified character-stream reader, using the specified XSL stylesheet base URL.
 void setXMLDataSource(org.w3c.dom.Document xmlSource)
          Sets the source as an XML document.
 void setXMLDataSource(java.io.InputStream xmlSource)
          Sets the source as an XML byte-stream reader.
 void setXMLDataSource(java.io.Reader xmlSource)
          Sets the source as an XML character-stream reader.
 void setXMLDataSource(java.lang.String xmlSource)
          Sets the source as an XML document from a URI.
 void setXSLFOSource(java.io.InputStream xslfoSource)
          Sets the source as an XSL FO byte-stream reader.
 void setXSLFOSource(java.io.Reader xslfoSource)
          Sets the source as an XSL FO character-stream reader.
 void setXSLFOSource(java.lang.String xslfoSource)
          Sets the source as an XSL FO document from a URI.
 
Methods inherited from class com.ibm.as400.util.reportwriter.processor.ReportProcessor
addPropertyChangeListener, addVetoableChangeListener, cancel, getCopies, getPageFormat, getPageRanges, getPageSelection, getReportName, isCancelled, removePropertyChangeListener, removeVetoableChangeListener, setContext, setCopies, setPageFormat, setPageRanges, setPageSelection, setReportName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSLReportProcessor

public XSLReportProcessor()
Constructs an XSLReportProcessor object. A call to setContext and setSource() must be done after calling this method.

XSLReportProcessor

public XSLReportProcessor(com.ibm.as400.util.reportwriter.processor.Context context)
Constructs an XSLReportProcessor object. A call to setSource() must be done after calling this method. The output generator to use for processing the report is specified by generator.
Parameters:
generator - the output generator to use for creating the report pages.
Method Detail

processReport

public void processReport()
                   throws java.io.IOException,
                          org.xml.sax.SAXException
Processes the report.
Overrides:
processReport in class ReportProcessor
Throws:
java.io.IOException - Thrown if an error occurs retrieving the input data.
XSLProcessorException - Thrown if an error occurs parsing/processing the data.

setXMLDataSource

public void setXMLDataSource(org.w3c.dom.Document xmlSource)
                      throws java.lang.NullPointerException
Sets the source as an XML document.
Parameters:
xmlSource - An XML source tree document. If the setTemplate() method is not called, the XML data stream must contain a xsl:stylesheet processing instruction (PI) of type 'text/xsl'.

setXMLDataSource

public void setXMLDataSource(java.lang.String xmlSource)
                      throws java.io.IOException,
                             java.lang.NullPointerException,
                             org.xml.sax.SAXException
Sets the source as an XML document from a URI.
Parameters:
xmlSource - An XML URI document. If the setTemplate() method is not called, the XML data stream must contain a xsl:stylesheet processing instruction (PI) of type 'text/xsl'.

setXMLDataSource

public void setXMLDataSource(java.io.Reader xmlSource)
                      throws java.io.IOException,
                             java.lang.NullPointerException,
                             org.xml.sax.SAXException
Sets the source as an XML character-stream reader.
Parameters:
xmlReader - A reader for XML data. If the setTemplate() method is not called, the XML data stream must contain a xsl:stylesheet processing instruction (PI) of type 'text/xsl'.
Throws:
java.io.IOException - Thrown if an error occurs retrieving the input data.
XSLProcessorException - Thrown if an error occurs parsing the data.

setXMLDataSource

public void setXMLDataSource(java.io.InputStream xmlSource)
                      throws java.io.IOException,
                             java.lang.NullPointerException,
                             org.xml.sax.SAXException
Sets the source as an XML byte-stream reader.
Parameters:
xmlByteStream - A reader for XML data. If the setTemplate() method is not called, the XML data stream must contain a xsl:stylesheet processing instruction (PI) of type 'text/xsl'.
Throws:
java.io.IOException - Thrown if an error occurs retrieving the input data.
XSLProcessorException - Thrown if an error occurs parsing the data.

setXSLFOSource

public void setXSLFOSource(java.lang.String xslfoSource)
                    throws java.io.IOException,
                           java.lang.NullPointerException,
                           org.xml.sax.SAXException
Sets the source as an XSL FO document from a URI.
Parameters:
xslfoSource - An XSL FO URI document.

setXSLFOSource

public void setXSLFOSource(java.io.Reader xslfoSource)
                    throws java.io.IOException,
                           java.lang.NullPointerException,
                           org.xml.sax.SAXException
Sets the source as an XSL FO character-stream reader.
Parameters:
xslfoReader - A reader for XSL FO data.
Throws:
java.io.IOException - Thrown if an error occurs retrieving the input data.
XSLProcessorException - Thrown if an error occurs parsing the data.

setXSLFOSource

public void setXSLFOSource(java.io.InputStream xslfoSource)
                    throws java.io.IOException,
                           java.lang.NullPointerException,
                           org.xml.sax.SAXException
Sets the source as an XSL FO byte-stream reader.
Parameters:
xslfoByteStream - A reader for XSL FO data.
Throws:
java.io.IOException - Thrown if an error occurs retrieving the input data.
XSLProcessorException - Thrown if an error occurs parsing the data.

setTemplate

public void setTemplate(org.w3c.dom.Document xslSource,
                        java.lang.String styleBaseURL)
                 throws java.lang.NullPointerException
Sets the formatting template as the specified XSL document, using the specified XSL stylesheet base URL. If no stylesheet base URL is used, null should be specified.
Parameters:
xslSource - An XSL source tree document.
styleBaseURL - The base directory from where to find included stylesheets.

setTemplate

public void setTemplate(java.lang.String xslSource,
                        java.lang.String styleBaseURL)
                 throws org.xml.sax.SAXException,
                        java.io.IOException,
                        java.lang.NullPointerException
Sets the formatting template as the specified character-stream reader, using the specified XSL stylesheet base URL. If no stylesheet base URL is used, null should be specified.
Parameters:
xslReader - A reader for an XSL stylesheet.
styleBaseURL - The base directory from where to find included stylesheets.
Throws:
java.io.IOException - Thrown if an error occurs retrieving the input data.
XSLProcessorException - Thrown if an error occurs parsing/processing the data.

setTemplate

public void setTemplate(java.io.Reader xslSource,
                        java.lang.String styleBaseURL)
                 throws org.xml.sax.SAXException,
                        java.io.IOException,
                        java.lang.NullPointerException
Sets the formatting template as the specified character-stream reader, using the specified XSL stylesheet base URL. If no stylesheet base URL is used, null should be specified.
Parameters:
xslReader - A reader for an XSL stylesheet.
styleBaseURL - The base directory from where to find included stylesheets.
Throws:
java.io.IOException - Thrown if an error occurs retrieving the input data.
XSLProcessorException - Thrown if an error occurs parsing/processing the data.

setTemplate

public void setTemplate(java.io.InputStream xslSource,
                        java.lang.String styleBaseURL)
                 throws org.xml.sax.SAXException,
                        java.io.IOException,
                        java.lang.NullPointerException
Sets the formatting template as the specified byte-stream reader, using the specified XSL stylesheet base URL. If no stylesheet base URL is used, null should be specified.
Parameters:
xslByteStream - A reader for an XSL stylesheet.
styleBaseURL - The base directory from where to find included stylesheets.
Throws:
java.io.IOException - Thrown if an error occurs retrieving the input data.
XSLProcessorException - Thrown if an error occurs parsing/processing the data.