Custom Infoset Validator API with SPI support
authorJohn Wass <wassj@ctc.com>
Thu, 5 Nov 2020 14:09:48 +0000 (09:09 -0500)
committerSteve Lawrence <stephen.d.lawrence@gmail.com>
Fri, 20 Nov 2020 14:06:29 +0000 (09:06 -0500)
commit81792fa3a45b1b5f3cd92a4b3a77ee7e569646e1
treeecc894ad38474242adbade44e42b3a28f52ae928
parente6d7f313fade0ef357c92e2df8fbe5ca173ed348
Custom Infoset Validator API with SPI support

Abstracted Validator implementation to support alternative validation backends.  The original Xerces validation was refactored to become the XercesValidator and implements this new API.

Support for loading implementations via SPI was added and is used to support the Daffodil CLI. The CLI is refactored to extend the --validate flag arguments to accept names used for SPI lookup.  The CLI arguments refactoring keeps backwards comapibility with previous argument handling.

DAFFODIL-2409
33 files changed:
daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
daffodil-cli/src/test/scala/org/apache/daffodil/TestValidatorPatterns.scala [new file with mode: 0644]
daffodil-japi/src/main/scala/org/apache/daffodil/japi/Daffodil.scala
daffodil-japi/src/main/scala/org/apache/daffodil/japi/packageprivate/Utils.scala
daffodil-japi/src/test/java/org/apache/daffodil/example/ValidatorApiExample.java [new file with mode: 0644]
daffodil-japi/src/test/java/org/apache/daffodil/example/ValidatorSpiExample.java [new file with mode: 0644]
daffodil-japi/src/test/java/org/apache/daffodil/example/validation/FailingValidator.java [new file with mode: 0644]
daffodil-japi/src/test/java/org/apache/daffodil/example/validation/FailingValidatorFactory.java [new file with mode: 0644]
daffodil-japi/src/test/java/org/apache/daffodil/example/validation/PassingValidator.java [new file with mode: 0644]
daffodil-japi/src/test/java/org/apache/daffodil/example/validation/PassingValidatorFactory.java [new file with mode: 0644]
daffodil-japi/src/test/resources/META-INF/services/org.apache.daffodil.api.ValidatorFactory [new file with mode: 0644]
daffodil-lib/src/main/resources/META-INF/services/org.apache.daffodil.api.ValidatorFactory [new file with mode: 0644]
daffodil-lib/src/main/scala/org/apache/daffodil/api/ValidationMode.scala
daffodil-lib/src/main/scala/org/apache/daffodil/api/Validator.scala [new file with mode: 0644]
daffodil-lib/src/main/scala/org/apache/daffodil/util/Validator.scala [deleted file]
daffodil-lib/src/main/scala/org/apache/daffodil/validation/Validators.scala [new file with mode: 0644]
daffodil-lib/src/main/scala/org/apache/daffodil/validation/XercesValidator.scala [new file with mode: 0644]
daffodil-lib/src/test/resources/.keep [deleted file]
daffodil-lib/src/test/resources/META-INF/services/org.apache.daffodil.api.ValidatorFactory [new file with mode: 0644]
daffodil-lib/src/test/resources/test/validation/testData1Infoset.xml [new file with mode: 0644]
daffodil-lib/src/test/resources/test/validation/testSchema1.dfdl.xsd [new file with mode: 0644]
daffodil-lib/src/test/scala/org/apache/daffodil/validation/TestValidatorsSPI.scala [new file with mode: 0644]
daffodil-lib/src/test/scala/org/apache/daffodil/validation/TestXercesValidator.scala [new file with mode: 0644]
daffodil-lib/src/test/scala/org/apache/daffodil/validation/ValidatorSPISupport.scala [new file with mode: 0644]
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataProcessor.scala
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/RuntimeData.scala
daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/Daffodil.scala
daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/packageprivate/Utils.scala
daffodil-sapi/src/test/resources/META-INF/services/org.apache.daffodil.api.ValidatorFactory [new file with mode: 0644]
daffodil-sapi/src/test/scala/org/apache/daffodil/example/ValidatorApiExample.scala [new file with mode: 0644]
daffodil-sapi/src/test/scala/org/apache/daffodil/example/ValidatorExamplesSupport.scala [new file with mode: 0644]
daffodil-sapi/src/test/scala/org/apache/daffodil/example/ValidatorSpiExample.scala [new file with mode: 0644]
project/Dependencies.scala