edu.princeton.wordnet.browser.domw3c
Class Transformer

java.lang.Object
  extended by edu.princeton.wordnet.browser.domw3c.Transformer

public class Transformer
extends java.lang.Object

Transform (document to XML text)

Author:
Bernard Bou

Field Summary
private  boolean outputHtml
          Output as html
private  java.lang.String theDtd
          Dtd string
 
Constructor Summary
Transformer()
          Constructor
Transformer(boolean thisOutputHtmlFlag, java.lang.String thisDtd)
          Constructor
 
Method Summary
 void documentToFile(org.w3c.dom.Document thisDocument, java.util.Map<java.lang.String,java.lang.String> theseParams, java.io.File thisOutputFile)
          Transform DOM document to XML file
 void documentToFile(org.w3c.dom.Document thisDocument, java.net.URL thisXsltUrl, java.util.Map<java.lang.String,java.lang.String> theseParams, java.io.File thisOutputFile)
          Transform DOM document to XML file after applying XSL transform
 java.lang.String documentToString(org.w3c.dom.Document thisDocument, java.util.Map<java.lang.String,java.lang.String> theseParams)
          Transform DOM document to XML string
 java.lang.String documentToString(org.w3c.dom.Document thisDocument, java.net.URL thisXsltUrl, java.util.Map<java.lang.String,java.lang.String> theseParams)
          Transform DOM document to XML string after applying XSL transformation
 java.io.InputStream pipe(org.w3c.dom.Document thisDocument, javax.xml.transform.Source thisXslt, java.util.Map<java.lang.String,java.lang.String> theseParams)
          Pipe transform output stream to returned inputstream
private  void toFile(org.w3c.dom.Document thisDocument, javax.xml.transform.Source thisXslt, java.util.Map<java.lang.String,java.lang.String> theseParams, java.io.File thisFile)
          Transform DOM document to XML file
private  void toStream(org.w3c.dom.Document thisDocument, javax.xml.transform.Source thisXslt, java.util.Map<java.lang.String,java.lang.String> theseParams, javax.xml.transform.stream.StreamResult thisResult)
          Transform DOM document to stream result
protected  java.lang.String toString(org.w3c.dom.Document thisDocument, javax.xml.transform.Source thisXslt, java.util.Map<java.lang.String,java.lang.String> theseParams)
          Transform DOM document to XML string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outputHtml

private final boolean outputHtml
Output as html


theDtd

private final java.lang.String theDtd
Dtd string

Constructor Detail

Transformer

public Transformer()
Constructor


Transformer

public Transformer(boolean thisOutputHtmlFlag,
                   java.lang.String thisDtd)
Constructor

Parameters:
thisOutputHtmlFlag - output as html
thisDtd - dtd id
Method Detail

documentToFile

public void documentToFile(org.w3c.dom.Document thisDocument,
                           java.util.Map<java.lang.String,java.lang.String> theseParams,
                           java.io.File thisOutputFile)
                    throws javax.xml.transform.TransformerConfigurationException,
                           javax.xml.transform.TransformerException
Transform DOM document to XML file

Parameters:
thisDocument - is the DOM Document to be output as XML
theseParams - parameters to transmit to the XSL transformer
thisOutputFile - is the output file
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerException
java.io.IOException

documentToFile

public void documentToFile(org.w3c.dom.Document thisDocument,
                           java.net.URL thisXsltUrl,
                           java.util.Map<java.lang.String,java.lang.String> theseParams,
                           java.io.File thisOutputFile)
                    throws javax.xml.transform.TransformerConfigurationException,
                           javax.xml.transform.TransformerException,
                           java.io.IOException
Transform DOM document to XML file after applying XSL transform

Parameters:
thisDocument - is the DOM Document to be output as XML
thisXsltUrl - is the XSLT source file
theseParams - parameters to transmit to the XSL transformer
thisOutputFile - is the output file
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerException
java.io.IOException

documentToString

public java.lang.String documentToString(org.w3c.dom.Document thisDocument,
                                         java.util.Map<java.lang.String,java.lang.String> theseParams)
                                  throws javax.xml.transform.TransformerConfigurationException,
                                         javax.xml.transform.TransformerException
Transform DOM document to XML string

Parameters:
thisDocument - is the DOM Document to be output as XML
theseParams - parameters to transmit to the XSL transformer
Returns:
XML String that represents DOM document
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerException
java.io.IOException

documentToString

public java.lang.String documentToString(org.w3c.dom.Document thisDocument,
                                         java.net.URL thisXsltUrl,
                                         java.util.Map<java.lang.String,java.lang.String> theseParams)
                                  throws javax.xml.transform.TransformerConfigurationException,
                                         javax.xml.transform.TransformerException,
                                         java.io.IOException
Transform DOM document to XML string after applying XSL transformation

Parameters:
thisDocument - is the DOM Document to be output as XML
thisXsltUrl - is the XSLT source url
theseParams - parameters to transmit to the XSL transformer
Returns:
XML String that represents DOM document
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerException
java.io.IOException

toString

protected java.lang.String toString(org.w3c.dom.Document thisDocument,
                                    javax.xml.transform.Source thisXslt,
                                    java.util.Map<java.lang.String,java.lang.String> theseParams)
                             throws javax.xml.transform.TransformerConfigurationException,
                                    javax.xml.transform.TransformerException
Transform DOM document to XML string

Parameters:
thisDocument - is the DOM Document to be output as XML
thisXslt - is the XSLT source
theseParams - parameters to transmit to the XSL transformer
Returns:
XML String that represents DOM document
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerException
java.io.IOException

toFile

private void toFile(org.w3c.dom.Document thisDocument,
                    javax.xml.transform.Source thisXslt,
                    java.util.Map<java.lang.String,java.lang.String> theseParams,
                    java.io.File thisFile)
             throws javax.xml.transform.TransformerConfigurationException,
                    javax.xml.transform.TransformerException
Transform DOM document to XML file

Parameters:
thisDocument - is the DOM Document to be output as XML
thisXslt - is the XSLT source
theseParams - parameters to transmit to the XSL transformer
thisFile - output file
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerException
java.io.IOException

toStream

private void toStream(org.w3c.dom.Document thisDocument,
                      javax.xml.transform.Source thisXslt,
                      java.util.Map<java.lang.String,java.lang.String> theseParams,
                      javax.xml.transform.stream.StreamResult thisResult)
               throws javax.xml.transform.TransformerConfigurationException,
                      javax.xml.transform.TransformerException
Transform DOM document to stream result

Parameters:
thisDocument - is the DOM Document to be output as XML
thisXslt - is the XSLT source
theseParams - parameters to pass to transformer
thisResult - is the stream result
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerException

pipe

public java.io.InputStream pipe(org.w3c.dom.Document thisDocument,
                                javax.xml.transform.Source thisXslt,
                                java.util.Map<java.lang.String,java.lang.String> theseParams)
                         throws java.io.IOException
Pipe transform output stream to returned inputstream

Parameters:
thisDocument - document
thisXslt - xslt
theseParams - parameters to pass to transformer
Returns:
inputstream
Throws:
java.io.IOException