olabusayoT commented on a change in pull request #436:
URL: https://github.com/apache/incubator-daffodil/pull/436#discussion_r511938339



##########
File path: daffodil-japi/src/main/scala/org/apache/daffodil/japi/Daffodil.scala
##########
@@ -953,3 +989,72 @@ class DaffodilXMLReader private[japi] (xmlrdr: 
SDaffodilXMLReader) extends org.x
    */
   def parse(arr: Array[Byte]): Unit = xmlrdr.parse(arr)
 }
+
+/**
+ * Accepts SAX callback events from any SAX XMLReader for unparsing
+ */
+class DaffodilUnparseContentHandler private[japi] (sContentHandler: 
SDaffodilUnparseContentHandler)
+  extends ContentHandlerProxy {
+
+  override protected val contentHandler: org.xml.sax.ContentHandler = 
sContentHandler
+
+  /**
+   * Returns the result of the SAX unparse containing diagnostic information. 
In the case of an
+   * DaffodilUnhandledSAXException, this will return null.
+   */
+  def getUnparseResult: UnparseResult =
+    new 
UnparseResult(sContentHandler.getUnparseResult.asInstanceOf[SUnparseResult])

Review comment:
       Ah great catch, the implementation should actually change. In the case 
of  an unhandleException sUnparseResult will be null, so we should not create 
an UnparseResult object from that and should return null instead




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to