|
Oracle® Application Server XML Java API Reference 10g Release 3 (10.1.3) B28238-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.xml.differ.XMLDiff
Defines an interface for comparing two XML files. It enables two XML files to be compared to check for their equivalence. It provides the objects to display the differences, if any, in a graphical format. The differences can also be represented as XSL. The corresponding XSL stylesheet with the differences can be generated as a file or an XMLDocument
object. The first XML file can be transformed into the second XML file by using the XSL stylesheet generated.
Constructor Summary | |
XMLDiff() Constructor |
Method Summary | |
boolean |
diff() Finds the differences between the two XML files or the two XMLDocument objects |
protected boolean |
equals(Node node1, Node node2) Method which performs the comparision of 2 nodes. |
void |
generateXSL(java.io.Writer out) Generates an XSL file of input filename which represents the differences between the 2 XML files which were set initially. |
XMLDocument |
generateXSLDoc() Generates an XSL stylesheet as an XMLDocument which represents the differences between the 2 XML documents set initially. |
void |
generateXSLFile(java.lang.String filename) Generates an XSL file of input filename which represents the differences between the 2 XML files which were set initially. |
javax.swing.JTextPane |
getDiffPane1() Gets the text panel as JTextPane object which visually shows the diffs in the first XML file. |
javax.swing.JTextPane |
getDiffPane2() Gets the text panel as JTextPane object which visually shows the diffs in the second XML file or document |
XMLDocument |
getDocument1() Gets the document root as an XMLDocument object of the first XML tree |
XMLDocument |
getDocument2() Gets the document root as an XMLDocument object of the second XML tree |
void |
printDiffTree(int tree, java.io.BufferedWriter out) Prints the diff tree which contains the node names and values which have been identified as diffs by the algorithm. |
void |
setDelWSBeforeDeletes(boolean val) Set option to remove whitespaces-only before a deleted node. |
void |
setDocuments(XMLDocument doc1, XMLDocument doc2) Sets the XML documents which need to be compared. |
void |
setFiles(java.io.File file1, java.io.File file2) Sets the XML files which need to be compared. |
void |
setIndentIncr(int spaces) Sets the indentation for the XSL generation. |
void |
setInput1(java.io.File file1) Sets the first XML file which need to be compared. |
void |
setInput1(InputSource inp1) Sets the first XML data source which need to be compared. |
void |
setInput1(XMLDocument doc1) Sets the first XML document which need to be compared. |
void |
setInput2(java.io.File file2) Sets the second XML file which need to be compared. |
void |
setInput2(InputSource inp2) Sets the second XML data source which need to be compared. |
void |
setInput2(XMLDocument doc2) Sets the second XML document which need to be compared. |
void |
setNewNodeIndentIncr(int spaces) Sets the indentation for the XSL generation. |
void |
setNoMoves() Assume that there are no moves to be detected by the diff algorithm. |
void |
setUrl1(java.lang.String url1) Sets the first XML url which need to be compared. |
void |
setUrl2(java.lang.String url2) Sets the second XML url which need to be compared. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface oracle.xml.async.DOMBuilderListener |
domBuilderError, domBuilderOver, domBuilderStarted |
Methods inherited from interface oracle.xml.async.DOMBuilderErrorListener |
domBuilderErrorCalled |
Constructor Detail |
public XMLDiff()
Method Detail |
public void setFiles(java.io.File file1, java.io.File file2) throws java.io.IOException, XMLParseException, SAXException, java.lang.InterruptedException
file1
- first XML filefile2
- second XML filejava.io.IOException
- thrown when an I/O error occursXMLParseException
- caused when parsing xml documentSAXException
- caused when parsing xml documentjava.lang.InterruptedException
- if a sleeping thread is interruptedpublic void setDocuments(XMLDocument doc1, XMLDocument doc2)
doc1
- first XML documentdoc2
- second XML documentpublic void setInput1(java.io.File file1) throws java.io.IOException, XMLParseException, SAXException, java.lang.InterruptedException
file1
- first XML filejava.io.IOException
- thrown when an I/O error occursXMLParseException
- caused when parsing xml documentSAXException
- caused when parsing xml documentjava.lang.InterruptedException
- if a sleeping thread is interruptedpublic void setInput2(java.io.File file2) throws java.io.IOException, XMLParseException, SAXException, java.lang.InterruptedException
file2
- second XML filejava.io.IOException
- thrown when an I/O error occursXMLParseException
- caused when parsing xml documentSAXException
- caused when parsing xml documentjava.lang.InterruptedException
- if a sleeping thread is interruptedpublic void setInput1(XMLDocument doc1)
doc1
- first XML documentpublic void setInput2(XMLDocument doc2)
doc2
- second XML documentpublic void setInput1(InputSource inp1) throws java.io.IOException, XMLParseException, SAXException
inp1
- XML data source as org.xml.sax.InputSouce
java.io.IOException
- thrown when an I/O error occursXMLParseException
- caused when parsing xml documentSAXException
- caused when parsing xml documentpublic void setInput2(InputSource inp2) throws java.io.IOException, XMLParseException, SAXException
inp2
- XML data source as org.xml.sax.InputSouce
java.io.IOException
- thrown when an I/O error occursXMLParseException
- caused when parsing xml documentSAXException
- caused when parsing xml documentpublic void setUrl1(java.lang.String url1) throws java.io.IOException, XMLParseException, SAXException, java.lang.InterruptedException
url1
- first XML urljava.io.IOException
- thrown when an I/O error occursXMLParseException
- caused when parsing xml documentSAXException
- caused when parsing xml documentjava.lang.InterruptedException
- if a sleeping thread is interruptedpublic void setUrl2(java.lang.String url2) throws java.io.IOException, XMLParseException, SAXException, java.lang.InterruptedException
url2
- second XML urljava.io.IOException
- thrown when an I/O error occursXMLParseException
- caused when parsing xml documentSAXException
- caused when parsing xml documentjava.lang.InterruptedException
- if a sleeping thread is interruptedpublic XMLDocument getDocument1()
XMLDocument
object of the first XML treepublic XMLDocument getDocument2()
XMLDocument
object of the second XML treepublic boolean diff() throws java.lang.NullPointerException
java.lang.NullPointerException
- occurs when xml files were not parsed successfully and this function was called. Or if xml documents have not been set.public javax.swing.JTextPane getDiffPane1()
JTextPane
object which visually shows the diffs in the first XML file.public javax.swing.JTextPane getDiffPane2()
JTextPane
object which visually shows the diffs in the second XML file or documentpublic void setIndentIncr(int spaces)
spaces
- indentation increment in number of spaces for attributespublic void setNewNodeIndentIncr(int spaces)
spaces
- indentation increment in number of spaces for new nodespublic void setDelWSBeforeDeletes(boolean val)
val
- true (deleted whitespace before deletes), false(do not delete whitespace before deletes).public void generateXSLFile(java.lang.String filename) throws java.io.IOException
filename
- output XSL file namejava.io.IOException
- could occur if the xsl file was not created successfullypublic XMLDocument generateXSLDoc() throws java.io.FileNotFoundException, SAXException, XMLParseException, java.io.IOException
XMLDocument
which represents the differences between the 2 XML documents set initially. The first XML file can be transformed into the second XML file using the XSL stylesheet generated. If the XML files were the same then the XSL generated will transform the first XML file into the second XML file, where the first and second files will equivalent.java.io.IOException
- could occur if the xsl file was not created successfullyjava.io.FileNotFoundException
- if xsl file generated could not be foundSAXException
- caused when parsing xml documentXMLParseException
- caused when parsing xml documentpublic void generateXSL(java.io.Writer out) throws java.io.IOException, java.lang.NullPointerException
out
- Generated XSLT will be written to 'out'.java.io.IOException
- could occur if the xsl file was not created successfullyjava.lang.NullPointerException
- could occur if input file name is nullprotected boolean equals(Node node1, Node node2)
node1
- first node to comparenode2
- second node to comparepublic void printDiffTree(int tree, java.io.BufferedWriter out) throws java.io.IOException
tree
- tree to print, i.e. one or twoout
- containing the printed diff treejava.io.IOException
- could occur if the xsl file was not created successfullypublic void setNoMoves()
|
Oracle® Application Server XML Java API Reference 10g Release 3 (10.1.3) B28238-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |