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
All Implemented Interfaces:
java.io.Serializable

public class XSLReportProcessor
extends ReportProcessor
implements java.io.Serializable

The XSLReportProcessor class is used to create a document/report by formatting XSL source data with an XSL stylesheet (consisting of formatting objects conforming to the Extensible Stylesheet Language Specification). A document may also be created from an XML file with imbedded XSL formatting objects. Both the output context and input data source must be specified before any pages of the report can be generated.

See Also:
Serialized Form

Fields inherited from class com.ibm.as400.util.reportwriter.processor.ReportProcessor
context_
 
Constructor Summary
XSLReportProcessor()
          Constructs an XSLReportProcessor object.
XSLReportProcessor(com.ibm.xsl.composer.framework.Context context)
          Constructs an XSLReportProcessor object.
 
Method Summary
 void processReport()
          Processes the report using the input source and context previously specified.
 void setTemplate(org.w3c.dom.Document xslSource)
          Sets the source of the XSL stylesheet content as a Document.
 void setTemplate(java.io.InputStream xslSource)
          Sets the formatting template as the specified byte-stream reader.
 void setTemplate(java.io.Reader xslSource)
          Sets the formatting template as the specified character-stream reader.
 void setTemplate(java.lang.String xslSource)
          Sets the source of the XSL stylesheet content as a String URI.
 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
setContext
 
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 must be done after calling this method.

XSLReportProcessor

public XSLReportProcessor(com.ibm.xsl.composer.framework.Context context)
                   throws java.lang.NullPointerException
Constructs an XSLReportProcessor object.
Parameters:
context - The context to use for creating the report pages.
Throws:
java.lang.NullPointerException - If the context is null.
Method Detail

processReport

public void processReport()
                   throws java.io.IOException,
                          org.xml.sax.SAXException,
                          java.lang.NullPointerException,
                          org.w3c.dom.DOMException
Processes the report using the input source and context previously specified.
Overrides:
processReport in class ReportProcessor
Throws:
java.io.IOException - If an error occurs while retrieving the input data.
org.xml.sax.SAXException - If an error occurs while parsing/processing the data.
java.lang.NullPointerException - If the data source or context is null.
org.w3c.dom.DOMException - If an error occurs while parsing/processing the formatting object tree.

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. A call to setTemplate must also be done to set the XSL data source.
Throws:
java.lang.NullPointerException - If the XML source is null.

setXMLDataSource

public void setXMLDataSource(java.lang.String xmlSource)
                      throws java.io.IOException,
                             java.lang.NullPointerException,
                             org.xml.sax.SAXException,
                             java.io.FileNotFoundException
Sets the source as an XML document from a URI.
Parameters:
xmlSource - An XML URI document. A call to setTemplate must also be done to set the XSL data source.
Throws:
java.io.IOException - If an error occurs while retrieving the data.
org.xml.sax.SAXException - If an error occurs while parsing/processing the data.
java.lang.NullPointerException - If the XML source is null.
java.io.FileNotFoundException - If the XML source file is not found.

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:
xmlSource - A reader for XML data. A call to setTemplate must also be done to set the XSL data source.
Throws:
java.io.IOException - If an error occurs while retrieving the data.
org.xml.sax.SAXException - If an error occurs while parsing/processing the data.
java.lang.NullPointerException - If the XML source is null.

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:
xmlSource - An XML byte-stream reader. A call to setTemplate must also be done to set the XSL data source.
Throws:
java.io.IOException - If an error occurs while retrieving the data.
org.xml.sax.SAXException - If an error occurs while parsing/processing the data.
java.lang.NullPointerException - If the XML source is null.

setXSLFOSource

public void setXSLFOSource(java.lang.String xslfoSource)
                    throws java.io.IOException,
                           java.lang.NullPointerException,
                           org.xml.sax.SAXException,
                           java.io.FileNotFoundException
Sets the source as an XSL FO document from a URI.
Parameters:
xslfoSource - An XSL FO URI document. The input source should contain XML data with imbedded XSL formatting object templates.
Throws:
java.io.IOException - If an error occurs while retrieving the data.
org.xml.sax.SAXException - If an error occurs while parsing/processing the data.
java.lang.NullPointerException - If the XSL FO source is null.
java.io.FileNotFoundException - If the XSL FO source file is not found.

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:
xslfoSource - A reader for XSL FO data.
Throws:
java.io.IOException - If an error occurs while retrieving the data.
org.xml.sax.SAXException - If an error occurs while parsing/processing the data.
java.lang.NullPointerException - If the XSL FO source is null.

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:
xslfoSource - A reader for XSL FO data.
Throws:
java.io.IOException - If an error occurs while retrieving the data.
org.xml.sax.SAXException - If an error occurs while parsing/processing the data.
java.lang.NullPointerException - If the XSL FO source is null.

setTemplate

public void setTemplate(org.w3c.dom.Document xslSource)
                 throws java.lang.NullPointerException
Sets the source of the XSL stylesheet content as a Document.
Parameters:
xslSource - An XSL source document.
Throws:
java.lang.NullPointerException - Thrown if the XSL source is null.

setTemplate

public void setTemplate(java.lang.String xslSource)
                 throws org.xml.sax.SAXException,
                        java.io.IOException,
                        java.lang.NullPointerException,
                        java.io.FileNotFoundException
Sets the source of the XSL stylesheet content as a String URI.
Parameters:
xslSource - An XSL URI document.
Throws:
java.io.IOException - If an error occurs while retrieving the data.
org.xml.sax.SAXException - If an error occurs while parsing/processing the data.
java.lang.NullPointerException - If the XSL source is null.
java.io.FileNotFoundException - If the XSL source file is not found.

setTemplate

public void setTemplate(java.io.Reader xslSource)
                 throws org.xml.sax.SAXException,
                        java.io.IOException,
                        java.lang.NullPointerException
Sets the formatting template as the specified character-stream reader.
Parameters:
xslSource - A reader for an XSL stylesheet.
Throws:
java.io.IOException - If an error occurs while retrieving the data.
org.xml.sax.SAXException - If an error occurs while parsing/processing the data.
java.lang.NullPointerException - If the XSL source is null.

setTemplate

public void setTemplate(java.io.InputStream xslSource)
                 throws org.xml.sax.SAXException,
                        java.io.IOException,
                        java.lang.NullPointerException
Sets the formatting template as the specified byte-stream reader.
Parameters:
xslSource - A reader for an XSL stylesheet.
Throws:
java.io.IOException - If an error occurs while retrieving the data.
org.xml.sax.SAXException - If an error occurs while parsing/processing the data.
java.lang.NullPointerException - If the XSL source is null.