Package com.itextpdf.kernel.utils
Class CompareToolResult
java.lang.Object
com.itextpdf.kernel.utils.CompareToolResult
Class containing results of the comparison of two pdf documents.
-
Constructor Summary
ConstructorsConstructorDescriptionCompareToolResult(int messageLimit) Creates new empty instance of CompareToolResult with given limit of difference messages. -
Method Summary
Modifier and TypeMethodDescriptionReturns map withObjectPathas keys and difference descriptions as values.intReturns number of differences between two documents detected during comparison.Converts this CompareToolResult into text form.booleanisOk()Verifies if documents are considered equal after comparison.voidwriteReportToXml(OutputStream stream) Converts this CompareToolResult into xml form.
-
Constructor Details
-
CompareToolResult
public CompareToolResult(int messageLimit) Creates new empty instance of CompareToolResult with given limit of difference messages.- Parameters:
-
messageLimit- maximum number of difference messages to be handled by this CompareToolResult.
-
-
Method Details
-
isOk
public boolean isOk()Verifies if documents are considered equal after comparison.- Returns:
- true if documents are equal, false otherwise.
-
getErrorCount
public int getErrorCount()Returns number of differences between two documents detected during comparison.- Returns:
- number of differences.
-
getReport
Converts this CompareToolResult into text form.- Returns:
- text report on the differences between two documents.
-
getDifferences
Returns map withObjectPathas keys and difference descriptions as values.- Returns:
- differences map which could be used to find in the document the objects that are different.
-
writeReportToXml
public void writeReportToXml(OutputStream stream) throws ParserConfigurationException, TransformerException Converts this CompareToolResult into xml form.- Parameters:
-
stream- output stream to which xml report will be written. - Throws:
-
ParserConfigurationException- if a XML DocumentBuilder cannot be created which satisfies the configuration requested. -
TransformerException- if it is not possible to create an XML Transformer instance or an unrecoverable error occurs during the course of the transformation.
-