Class CompareTool.CompareResult

Enclosing class:

public static class CompareTool.CompareResult extends Object
Class containing results of the comparison of two documents.
  • Field Details

    • differences

      protected Map<ObjectPath,String> differences
    • messageLimit

      protected int messageLimit
  • Constructor Details

    • CompareResult

      public CompareResult (int messageLimit)
      Creates new empty instance of CompareResult with given limit of difference messages.
      messageLimit - maximum number of difference messages to be handled by this CompareResult.
  • Method Details

    • isOk

      public boolean isOk()
      Verifies if documents are considered equal after comparison.
      true if documents are equal, false otherwise.
    • getErrorCount

      public int getErrorCount()
      Returns number of differences between two documents detected during comparison.
      number of differences.
    • getReport

      public String getReport()
      Converts this CompareResult into text form.
      text report on the differences between two documents.
    • getDifferences

      public Map<ObjectPath,String> getDifferences()
      Returns map with ObjectPath as keys and difference descriptions as values.
      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 CompareResult into xml form.
      stream - output stream to which xml report will be written.
      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.
    • isMessageLimitReached

      protected boolean isMessageLimitReached()
    • addError

      protected void addError (ObjectPath path, String message)