com.calitha.xml
Interface IDocumentTransformer

All Known Implementing Classes:
DocumentTransformer

public interface IDocumentTransformer

The IDocumentTransformer represents a class that can transform Document objects using an XSL template and writes the output to various targets.

The transformer can also take a map of parameters used for the transformation.

Author:
Robert van Loenhout

Method Summary
 Map<String,String> getParameters()
          Gets parameters used in the transformation.
 void setParameters(Map<String,String> parameters)
          Sets parameters used in the parameters.
 void setTemplate(File file)
          Sets the XSL template that will be used in the transformation.
 void setTemplate(String resourceName)
          Sets the XSL template that will be used in the transformation.
 void setTemplate(URL url)
          Sets the XSL template that will be used in the transformation.
 String transform(Document document)
          Transforms a document.
 void transform(File file, Document document)
          Transforms a document.
 void transform(OutputStream out, Document document)
          Transforms a document.
 void transform(Writer writer, Document document)
          Transforms a document.
 

Method Detail

setTemplate

void setTemplate(File file)
                 throws IOException,
                        TransformerConfigurationException
Sets the XSL template that will be used in the transformation.

Parameters:
file - XSL template
Throws:
IOException - if an I/O error occurs
TransformerConfigurationException - if a serious configuration error

setTemplate

void setTemplate(String resourceName)
                 throws IOException,
                        TransformerConfigurationException
Sets the XSL template that will be used in the transformation.

Parameters:
resourceName - XSL template
Throws:
IOException - if an I/O error occurs
TransformerConfigurationException - if a serious configuration error

setTemplate

void setTemplate(URL url)
                 throws IOException,
                        TransformerConfigurationException
Sets the XSL template that will be used in the transformation.

Parameters:
url - XSL template
Throws:
IOException - if an I/O error occurs
TransformerConfigurationException - if a serious configuration error

getParameters

Map<String,String> getParameters()
Gets parameters used in the transformation.

Returns:
parameters

setParameters

void setParameters(Map<String,String> parameters)
Sets parameters used in the parameters.

Parameters:
parameters - parameters

transform

void transform(Writer writer,
               Document document)
               throws TransformerException,
                      IOException
Transforms a document.

Parameters:
writer - output
document - document
Throws:
IOException - if an I/O error occurs
TransformerConfigurationException - if a serious configuration error
TransformerException

transform

void transform(OutputStream out,
               Document document)
               throws TransformerException,
                      IOException
Transforms a document.

Parameters:
out - output
document - document
Throws:
IOException - if an I/O error occurs
TransformerConfigurationException - if a serious configuration error
TransformerException

transform

void transform(File file,
               Document document)
               throws IOException,
                      TransformerException
Transforms a document.

Parameters:
file - output
document - document
Throws:
IOException - if an I/O error occurs
TransformerConfigurationException - if a serious configuration error
TransformerException

transform

String transform(Document document)
                 throws TransformerException,
                        IOException
Transforms a document.

Parameters:
document - document
Returns:
string containing the transformed document
Throws:
IOException - if an I/O error occurs
TransformerConfigurationException - if a serious configuration error
TransformerException