|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | 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 |
void |
domBuilderError(DOMBuilderEvent p0)
Method implementing the DOMBuilderErrorListener interface
called only by the DOM parser. |
void |
domBuilderErrorCalled(DOMBuilderErrorEvent p0)
Method implementing the DOMBuilderErrorListener interface
called only by the DOM parser when there is an error while parsing. |
void |
domBuilderOver(DOMBuilderEvent p0)
Method implementing DOMBuilderListener interface called
only by a DOM parser thread when the parsing is done. |
void |
domBuilderStarted(DOMBuilderEvent p0)
Method implementing DOMBuilderListener interface called
only by the DOM parser when the parsing starts. |
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(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(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. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
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
File
- first XML file, File second XML filepublic void setDocuments(XMLDocument doc1, XMLDocument doc2)
XMLDocument
- first XML document, XML Document second XML documentpublic void setInput1(java.io.File file1) throws java.io.IOException, XMLParseException, SAXException, java.lang.InterruptedException
File
- first XML filepublic void setInput2(java.io.File file2) throws java.io.IOException, XMLParseException, SAXException, java.lang.InterruptedException
File
- second XML filepublic void setInput1(XMLDocument doc1)
XMLDocument
- first XML documentpublic void setInput2(XMLDocument doc2)
XML
- Document second XML documentpublic XMLDocument getDocument1()
XMLDocument
object of the
first XML treepublic XMLDocument getDocument2()
XMLDocument
object of the
second XML treepublic boolean diff() throws java.lang.NullPointerException
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)
int
- indentation increment in number of spaces for attributespublic void setNewNodeIndentIncr(int spaces)
int
- indentation increment in number of spaces for new nodespublic void setDelWSBeforeDeletes(boolean val)
boolean
- val, true (deleted whitespace before deletes), false(do not * delete whitespace before deletes.public void generateXSLFile(java.lang.String filename) throws java.io.IOException
String
- output XSL file namepublic 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.public void generateXSL(java.io.Writer out) throws java.io.IOException, java.lang.NullPointerException
Writer
- out Generated XSLT will be written to 'out'.protected boolean equals(Node node1, Node node2)
Node
- node1 first node to compareNode
- node2 second node to comparepublic void domBuilderErrorCalled(DOMBuilderErrorEvent p0)
DOMBuilderErrorListener
interface
called only by the DOM parser when there is an error while parsing.DOMBuilderErrorEvent
- error object thrown by parserpublic void domBuilderError(DOMBuilderEvent p0)
DOMBuilderErrorListener
interface
called only by the DOM parser.DOMBuilderEvent
- parser event
Parser errors handled by domBuilderErrorCalled
public void domBuilderOver(DOMBuilderEvent p0)
DOMBuilderListener
interface called
only by a DOM parser thread when the parsing is done.DOMBuilderEvent
- parser eventpublic void domBuilderStarted(DOMBuilderEvent p0)
DOMBuilderListener
interface called
only by the DOM parser when the parsing starts.DOMBuilderEvent
- parser eventpublic void printDiffTree(int tree, java.io.BufferedWriter out) throws java.io.IOException
int
- the tree to print, i.e. one or twoBufferedWriter
- containing the printed diff treepublic void setNoMoves()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |