stevedlawrence commented on a change in pull request #520:
URL: https://github.com/apache/daffodil/pull/520#discussion_r608153349
##########
File path: daffodil-japi/src/main/scala/org/apache/daffodil/japi/Daffodil.scala
##########
@@ -866,6 +867,12 @@ class ParseResult private[japi] (pr: SParseResult,
deprecatedOutput: Maybe[JDOMI
* @return true if any validation errors occurred, false otherwise.
*/
def isValidationError(): Boolean = pr.isValidationError
+
+ /**
+ * Optional result of the infoset validation.
+ * @return optional ValidationResult
+ */
+ def validationResult(): Option[ValidationResult] = pr.validationResult()
Review comment:
Ah, I somehow missed the sapi/japi changes. Two concerns here though:
1. ``Option`` is a Scala thing that isn't familiar to Java users so should
be avoided in the JAPI. This API should follow Java conventions, which I guess
means return null if there is no ValidationResult?
2. The ValidationResult that is returned is in the org.apache.daffodil.api
package. But the Java/Scala doc that we generate only comes from the
org.apache.daffodil.sapi/japi packages. This means no documentation will be
generated for the ValidationResult, so users wont' really know how to use it.
The way we have been maintaining the Java and Scala API is to create wrappers
in sapi/japi that are essentially proxies for classes outside of those
packages. So there would be a japi.ValidationResult and sapi.ValidationResult
which wrap the api.ValidationResult, but have java/scaladoc that the user will
see. It's kindof terrible, and we have tickets to fix this so there's only a
single API and not all these proxy classes, but it's the standard for what we
have right now. It's does also have a nice benefit in that it makes it very
clear what is public API and what isn't (i.e. if it's in the
org.apache.daffodil.sapi/japi then it's public), and clearly defines when we
need to be concerned w
ith backwards compatibility.
--
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]