com.calitha.xml
Class DocumentTransformer

java.lang.Object
  extended by com.calitha.xml.DocumentTransformer
All Implemented Interfaces:
IDocumentTransformer

public class DocumentTransformer
extends Object
implements IDocumentTransformer

Author:
Robert van Loenhout

Constructor Summary
DocumentTransformer()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentTransformer

public DocumentTransformer()
Method Detail

setTemplate

public void setTemplate(File file)
                 throws IOException,
                        TransformerConfigurationException
Description copied from interface: IDocumentTransformer
Sets the XSL template that will be used in the transformation.

Specified by:
setTemplate in interface IDocumentTransformer
Parameters:
file - XSL template
Throws:
IOException - if an I/O error occurs
TransformerConfigurationException - if a serious configuration error

setTemplate

public void setTemplate(String resourceName)
                 throws IOException,
                        TransformerConfigurationException
Description copied from interface: IDocumentTransformer
Sets the XSL template that will be used in the transformation.

Specified by:
setTemplate in interface IDocumentTransformer
Parameters:
resourceName - XSL template
Throws:
IOException - if an I/O error occurs
TransformerConfigurationException - if a serious configuration error

setTemplate

public void setTemplate(URL url)
                 throws IOException,
                        TransformerConfigurationException
Description copied from interface: IDocumentTransformer
Sets the XSL template that will be used in the transformation.

Specified by:
setTemplate in interface IDocumentTransformer
Parameters:
url - XSL template
Throws:
IOException - if an I/O error occurs
TransformerConfigurationException - if a serious configuration error

getParameters

public Map<String,String> getParameters()
Description copied from interface: IDocumentTransformer
Gets parameters used in the transformation.

Specified by:
getParameters in interface IDocumentTransformer
Returns:
parameters

setParameters

public void setParameters(Map<String,String> parameters)
Description copied from interface: IDocumentTransformer
Sets parameters used in the parameters.

Specified by:
setParameters in interface IDocumentTransformer
Parameters:
parameters - parameters

transform

public void transform(Writer writer,
                      Document document)
               throws TransformerException,
                      IOException
Description copied from interface: IDocumentTransformer
Transforms a document.

Specified by:
transform in interface IDocumentTransformer
Parameters:
writer - output
document - document
Throws:
TransformerConfigurationException - if a serious configuration error
IOException - if an I/O error occurs
TransformerException

transform

public void transform(OutputStream out,
                      Document document)
               throws TransformerException,
                      IOException
Description copied from interface: IDocumentTransformer
Transforms a document.

Specified by:
transform in interface IDocumentTransformer
Parameters:
out - output
document - document
Throws:
TransformerConfigurationException - if a serious configuration error
IOException - if an I/O error occurs
TransformerException

transform

public void transform(File file,
                      Document document)
               throws IOException,
                      TransformerException
Description copied from interface: IDocumentTransformer
Transforms a document.

Specified by:
transform in interface IDocumentTransformer
Parameters:
file - output
document - document
Throws:
IOException - if an I/O error occurs
TransformerConfigurationException - if a serious configuration error
TransformerException

transform

public String transform(Document document)
                 throws TransformerException,
                        IOException
Description copied from interface: IDocumentTransformer
Transforms a document.

Specified by:
transform in interface IDocumentTransformer
Parameters:
document - document
Returns:
string containing the transformed document
Throws:
TransformerConfigurationException - if a serious configuration error
IOException - if an I/O error occurs
TransformerException