From 4115790645eb8582d82676317da179ad0af67669 Mon Sep 17 00:00:00 2001 From: Philip Helger Date: Wed, 10 Apr 2024 16:42:08 +0200 Subject: [PATCH] Replaced deprecated API --- README.md | 1 + .../com/helger/phive/cii/CIIValidation.java | 10 +- .../phive/ciuspt/CIUS_PTValidation.java | 16 +- .../phive/ciusro/CIUS_ROValidation.java | 20 +- .../ebinterface/EbInterfaceValidation.java | 26 +- .../com/helger/phive/ehf/EHFValidationG2.java | 64 +- .../com/helger/phive/ehf/EHFValidationG3.java | 38 +- .../phive/ehf/EHFValidationG3_2023_02.java | 38 +- .../phive/en16931/EN16931Validation.java | 122 +-- .../EnergieEFactuurValidation.java | 18 +- .../phive/facturae/FacturaeValidation.java | 18 +- .../phive/fatturapa/FatturaPAValidation.java | 14 +- .../phive/finvoice/FinvoiceValidation.java | 16 +- .../helger/phive/isdoc/ISDOCValidation.java | 12 +- .../phive/oioubl/OIOUBLLegacyValidation.java | 38 +- .../helger/phive/oioubl/OIOUBLValidation.java | 106 +-- .../italy/PeppolItalyValidation2_2_9.java | 14 +- .../italy/PeppolItalyValidation2_3_0.java | 23 +- .../italy/PeppolItalyValidation3_0_2.java | 20 +- .../PeppolLegacyThirdpartyValidation.java | 18 +- .../legacy/PeppolLegacyValidationAUNZ.java | 138 ++-- .../PeppolLegacyValidationReporting.java | 42 +- .../legacy/PeppolLegacyValidationSG.java | 21 +- .../peppol/legacy/PeppolValidation350.java | 30 +- .../peppol/legacy/PeppolValidation360.java | 28 +- .../peppol/legacy/PeppolValidation370.java | 34 +- .../peppol/legacy/PeppolValidation380.java | 30 +- .../peppol/legacy/PeppolValidation381.java | 30 +- .../peppol/legacy/PeppolValidation390.java | 30 +- .../peppol/legacy/PeppolValidation391.java | 30 +- .../peppol/legacy/PeppolValidation3_10_0.java | 48 +- .../peppol/legacy/PeppolValidation3_10_1.java | 30 +- .../peppol/legacy/PeppolValidation3_11_0.java | 30 +- .../peppol/legacy/PeppolValidation3_11_1.java | 30 +- .../peppol/legacy/PeppolValidation3_12_0.java | 30 +- .../peppol/legacy/PeppolValidation3_13_0.java | 30 +- .../peppol/legacy/PeppolValidation3_14_0.java | 32 +- .../peppol/legacy/PeppolValidation3_15_0.java | 32 +- .../phive/peppol/PeppolValidation2023_05.java | 36 +- .../phive/peppol/PeppolValidation2023_11.java | 38 +- .../phive/peppol/PeppolValidationAUNZ.java | 24 +- .../peppol/PeppolValidationDirectory.java | 14 +- .../phive/peppol/PeppolValidationJP.java | 12 +- .../phive/peppol/PeppolValidationMY.java | 16 +- .../phive/peppol/PeppolValidationPINT.java | 16 +- .../peppol/PeppolValidationReporting.java | 16 +- .../phive/peppol/PeppolValidationSG.java | 16 +- .../com/helger/phive/setu/SETUValidation.java | 10 +- .../SimplerInvoicingValidation.java | 106 +-- .../svefaktura/SvefakturaValidation.java | 12 +- .../helger/phive/teapps/TEAPPSValidation.java | 12 +- .../com/helger/phive/ubl/UBLValidation.java | 730 +++++++++--------- .../helger/phive/ublbe/UBLBEValidation.java | 52 +- .../phive/xrechnung/XRechnungValidation.java | 62 +- 54 files changed, 1419 insertions(+), 1060 deletions(-) diff --git a/README.md b/README.md index f881fb55..9d88f3ec 100644 --- a/README.md +++ b/README.md @@ -192,6 +192,7 @@ I hope that with the introduction of PINT, the versioning problem will be solved # News and noteworthy * v3.1.10 - work in progress + * Added support for EN 16931 rules v1.3.12 format and deprecated v1.3.10 * All OIOUBL 1.x validations are now correctly based on UBL 2.1 instead of UBL 2.0 * Extracted the rules for the legacy OIOUBL rules into a separate registerable entity (`OIOUBLLegacyValidation`). * v3.1.9 - 2024-03-22 diff --git a/phive-rules-cii/src/main/java/com/helger/phive/cii/CIIValidation.java b/phive-rules-cii/src/main/java/com/helger/phive/cii/CIIValidation.java index fe7b4600..fbbcafc5 100644 --- a/phive-rules-cii/src/main/java/com/helger/phive/cii/CIIValidation.java +++ b/phive-rules-cii/src/main/java/com/helger/phive/cii/CIIValidation.java @@ -25,6 +25,8 @@ import com.helger.diver.api.version.VESID; import com.helger.phive.api.executorset.IValidationExecutorSetRegistry; import com.helger.phive.api.executorset.ValidationExecutorSet; +import com.helger.phive.api.executorset.status.IValidationExecutorSetStatus; +import com.helger.phive.api.executorset.status.ValidationExecutorSetStatus; import com.helger.phive.xml.schematron.SchematronNamespaceBeautifier; import com.helger.phive.xml.source.IValidationSourceXML; import com.helger.phive.xml.xsd.ValidationExecutorXSD; @@ -47,6 +49,12 @@ public final class CIIValidation private CIIValidation () {} + @Nonnull + private static IValidationExecutorSetStatus _createStatus (final boolean bIsDeprecated) + { + return ValidationExecutorSetStatus.createDeprecatedNow (bIsDeprecated); + } + /** * Register all standard CII D16B validation execution sets to the provided * registry. @@ -66,7 +74,7 @@ public static void initCIID16B (@Nonnull final IValidationExecutorSetRegistry XSD_UTITLITY_STATEMENT = new CommonsArrayList <> (CUBL20.XSD_CODELIST_UNIT_CODE, CUBL20.XSD_CODELIST_MIME_MEDIA_TYPE_CODE, CUBL20.XSD_CODELIST_CURRENCY_CODE, @@ -232,7 +242,7 @@ public static void initOIOUBL (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -85,7 +93,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -90,13 +99,13 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -97,7 +105,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -91,7 +99,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aVESInvoiceAT = ValidationExecutorSet.createDerived (aVESInvoice, VID_OPENPEPPOL_T10_AT_NAT, "OpenPeppol Invoice (Austria)", - bDeprecated, + _createStatus (bDeprecated), ValidationExecutorSchematron.createXSLT (INVOICE_AT_NAT, sPreReqInvoice, aNSCtxInvoice)); @@ -99,7 +107,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aVESCreditNoteAT = ValidationExecutorSet.createDerived (aVESCreditNote, VID_OPENPEPPOL_T14_AT_NAT, "OpenPeppol Credit Note (Austria)", - bDeprecated, + _createStatus (bDeprecated), ValidationExecutorSchematron.createXSLT (CREDIT_NOTE_AT_NAT, sPreReqCreditNote, aNSCtxCreditNote)); @@ -116,7 +124,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -323,7 +275,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -89,7 +87,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -96,7 +101,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); final String sVersion = " (" + VERSION_STR + ")"; - final boolean bIsDeprecated = true; + final boolean bDeprecated = true; aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T01_V2, "OpenPeppol Order" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllOrderXSDs ()), _createPure (ORDER_RULES), _createPure (ORDER_OPENPEPPOL), _createPure (ORDER_OPENPEPPOL_CORE))); aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T10_V2, "OpenPeppol Invoice" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllInvoiceXSDs ()), _createPure (INVOICE_RULES), _createPure (INVOICE_OPENPEPPOL), _createPure (INVOICE_OPENPEPPOL_CORE))); aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T14_V2, "OpenPeppol Credit Note" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllCreditNoteXSDs ()), _createPure (CREDIT_NOTE_RULES), _createPure (CREDIT_NOTE_OPENPEPPOL), _createPure (CREDIT_NOTE_OPENPEPPOL_CORE))); aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T16_V2, "OpenPeppol Despatch Advice" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllDespatchAdviceXSDs ()), _createPure (DESPATCH_ADVICE_RULES), _createPure (DESPATCH_ADVICE_OPENPEPPOL), _createPure (DESPATCH_ADVICE_OPENPEPPOL_CORE))); aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T19_V2, "OpenPeppol Catalogue" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllCatalogueXSDs ()), _createPure (CATALOGUE_RULES), _createSCH (CATALOGUE_OPENPEPPOL), _createPure (CATALOGUE_OPENPEPPOL_CORE))); aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T58_V2, "OpenPeppol Catalogue Response" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllApplicationResponseXSDs ()), _createPure (CATALOGUE_RESPONSE_RULES), _createPure (CATALOGUE_RESPONSE_OPENPEPPOL), _createPure (CATALOGUE_RESPONSE_OPENPEPPOL_CORE))); aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T71_V2, "OpenPeppol MLR" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllApplicationResponseXSDs ()), _createPure (MLR_RULES), _createPure (MLR_OPENPEPPOL), _createPure (MLR_OPENPEPPOL_CORE))); aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T76_V2, "OpenPeppol Order Response" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllOrderResponseXSDs ()), _createPure (ORDER_RESPONSE_RULES), _createPure (ORDER_RESPONSE_OPENPEPPOL), _createPure (ORDER_RESPONSE_OPENPEPPOL_CORE))); aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T77_V1, "OpenPeppol Punch Out" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllCatalogueXSDs ()), _createPure (PUNCH_OUT_RULES), _createPure (PUNCH_OUT_OPENPEPPOL))); // Must use XSLT based conversion because of custom XSLT function! aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_T110_V1, "OpenPeppol Order Agreement" + sVersion, - bIsDeprecated, + _createStatus (bDeprecated), ValidationExecutorXSD.create (UBL21Marshaller.getAllOrderResponseXSDs ()), _createSCH (ORDER_AGREEMENT_RULES), _createSCH (ORDER_AGREEMENT_OPENPEPPOL))); diff --git a/phive-rules-peppol-legacy/src/main/java/com/helger/phive/peppol/legacy/PeppolValidation360.java b/phive-rules-peppol-legacy/src/main/java/com/helger/phive/peppol/legacy/PeppolValidation360.java index 1b33131e..aaac2a29 100644 --- a/phive-rules-peppol-legacy/src/main/java/com/helger/phive/peppol/legacy/PeppolValidation360.java +++ b/phive-rules-peppol-legacy/src/main/java/com/helger/phive/peppol/legacy/PeppolValidation360.java @@ -30,6 +30,8 @@ import com.helger.diver.api.version.VESID; import com.helger.phive.api.executorset.IValidationExecutorSetRegistry; import com.helger.phive.api.executorset.ValidationExecutorSet; +import com.helger.phive.api.executorset.status.IValidationExecutorSetStatus; +import com.helger.phive.api.executorset.status.ValidationExecutorSetStatus; import com.helger.phive.xml.schematron.ValidationExecutorSchematron; import com.helger.phive.xml.source.IValidationSourceXML; import com.helger.phive.xml.xsd.ValidationExecutorXSD; @@ -224,6 +226,12 @@ private static ValidationExecutorSchematron _createXSLT (@Nonnull final IReadabl return ValidationExecutorSchematron.createXSLT (aRes, UBL21NamespaceContext.getInstance ()); } + @Nonnull + private static IValidationExecutorSetStatus _createStatus (final boolean bIsDeprecated) + { + return ValidationExecutorSetStatus.createDeprecatedNow (bIsDeprecated); + } + public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -232,70 +240,70 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -196,14 +204,14 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -125,7 +133,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -125,7 +133,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -125,7 +133,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -125,7 +133,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -185,7 +193,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -133,7 +141,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -135,7 +143,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -134,7 +142,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -134,7 +142,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -134,7 +142,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -150,7 +158,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -128,7 +136,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -137,7 +145,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -136,7 +144,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -110,7 +118,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -74,7 +82,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -80,7 +88,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -85,7 +93,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -90,13 +98,13 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -78,7 +86,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry aRegistry) { ValueEnforcer.notNull (aRegistry, "Registry"); @@ -94,7 +102,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry