pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1642972 - /pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/parser/XmlResultParser.java
Date Tue, 02 Dec 2014 18:05:28 GMT
Author: tilman
Date: Tue Dec  2 18:05:28 2014
New Revision: 1642972

URL: http://svn.apache.org/r1642972
Log:
PDFBOX-2529: add page in preflight XML output

Modified:
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/parser/XmlResultParser.java

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/parser/XmlResultParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/parser/XmlResultParser.java?rev=1642972&r1=1642971&r2=1642972&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/parser/XmlResultParser.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/parser/XmlResultParser.java
Tue Dec  2 18:05:28 2014
@@ -107,18 +107,25 @@ public class XmlResultParser
         Map<ValidationError, Integer> cleaned = cleanErrorList(result.getErrorsList());
         preflight.appendChild(errors);
         int totalCount = 0;
-        for (Map.Entry<ValidationError,Integer> entry : cleaned.entrySet())
+        for (Map.Entry<ValidationError, Integer> entry : cleaned.entrySet())
         {
             Element error = rdocument.createElement("error");
             int count = entry.getValue();
-            error.setAttribute("count", String.format("%d",count));
+            error.setAttribute("count", String.format("%d", count));
             totalCount += count;
             Element code = rdocument.createElement("code");
-            code.setTextContent(entry.getKey().getErrorCode());
+            ValidationError ve = entry.getKey();
+            code.setTextContent(ve.getErrorCode());
             error.appendChild(code);
             Element detail = rdocument.createElement("details");
-            detail.setTextContent(entry.getKey().getDetails());
+            detail.setTextContent(ve.getDetails());
             error.appendChild(detail);
+            if (ve.getPageNumber() != null)
+            {
+                Element page = rdocument.createElement("page");
+                page.setTextContent(ve.getPageNumber().toString());
+                error.appendChild(page);
+            }
             errors.appendChild(error);
         }
         errors.setAttribute("count", String.format("%d", totalCount));



Mime
View raw message