org.apache.fop.cli

Class InputHandler

Implemented Interfaces:
ErrorListener, Renderable
Known Direct Subclasses:
AreaTreeInputHandler

public class InputHandler
extends java.lang.Object
implements ErrorListener, Renderable

Class for handling files input from command line either with XML and XSLT files (and optionally xsl parameters) or FO File input alone

Field Summary

protected Log
log
the logger

Constructor Summary

InputHandler(File fofile)
Constructor for FO input
InputHandler(File xmlfile, File xsltfile, Vector params)
Constructor for XML->XSLT->FO input

Method Summary

void
error(TransformerException exc)
void
fatalError(TransformerException exc)
void
renderTo(FOUserAgent userAgent, String outputFormat)
void
renderTo(FOUserAgent userAgent, String outputFormat, OutputStream out)
Generate a document, given an initialized Fop object
void
transformTo(OutputStream out)
In contrast to render(Fop) this method only performs the XSLT stage and saves the intermediate XSL-FO file to the output file.
protected void
transformTo(Result result)
Transforms the input document to the input format expected by FOP using XSLT.
void
warning(TransformerException exc)

Field Details

log

protected Log log
the logger

Constructor Details

InputHandler

public InputHandler(File fofile)
Constructor for FO input
Parameters:
fofile - the file to read the FO document.

InputHandler

public InputHandler(File xmlfile,
                    File xsltfile,
                    Vector params)
Constructor for XML->XSLT->FO input
Parameters:
xmlfile - XML file
xsltfile - XSLT file
params - Vector of command-line parameters (name, value, name, value, ...) for XSL stylesheet, null if none

Method Details

error

public void error(TransformerException exc)
See Also:
javax.xml.transform.ErrorListener.error(javax.xml.transform.TransformerException)

fatalError

public void fatalError(TransformerException exc)
            throws TransformerException
See Also:
javax.xml.transform.ErrorListener.fatalError(javax.xml.transform.TransformerException)

renderTo

public void renderTo(FOUserAgent userAgent,
                     String outputFormat)
            throws FOPException
Specified by:
renderTo in interface Renderable
See Also:
Renderable

renderTo

public void renderTo(FOUserAgent userAgent,
                     String outputFormat,
                     OutputStream out)
            throws FOPException
Generate a document, given an initialized Fop object
Parameters:
userAgent - the user agent
outputFormat - the output format to generate (MIME type, see MimeConstants)
out - the output stream to write the generated output to (may be null if not applicable)
Throws:
FOPException - in case of an error during processing

transformTo

public void transformTo(OutputStream out)
            throws FOPException
In contrast to render(Fop) this method only performs the XSLT stage and saves the intermediate XSL-FO file to the output file.
Parameters:
out - OutputStream to write the transformation result to.
Throws:
FOPException - in case of an error during processing

transformTo

protected void transformTo(Result result)
            throws FOPException
Transforms the input document to the input format expected by FOP using XSLT.
Parameters:
result - the Result object where the result of the XSL transformation is sent to
Throws:
FOPException - in case of an error during processing

warning

public void warning(TransformerException exc)
See Also:
javax.xml.transform.ErrorListener.warning(javax.xml.transform.TransformerException)

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.