Skip to content

Commit

Permalink
Replaced deprecated API
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Apr 10, 2024
1 parent 87830c9 commit 4115790
Show file tree
Hide file tree
Showing 54 changed files with 1,419 additions and 1,060 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.
Expand All @@ -66,7 +74,7 @@ public static void initCIID16B (@Nonnull final IValidationExecutorSetRegistry <I
// No Schematrons here
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CII_D16B_CROSSINDUSTRYINVOICE,
"CII CrossIndustryInvoice " + VERSION_D16B,
bNotDeprecated,
_createStatus (bNotDeprecated),
ValidationExecutorXSD.create (CCIID16B.getXSDResource ())));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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;
Expand Down Expand Up @@ -74,6 +76,12 @@ private static ClassLoader _getCL ()
return CIUS_PTValidation.class.getClassLoader ();
}

@Nonnull
private static IValidationExecutorSetStatus _createStatus (final boolean bIsDeprecated)
{
return ValidationExecutorSetStatus.createDeprecatedNow (bIsDeprecated);
}

/**
* Register all standard CIUS-PT validation execution sets to the provided
* registry.
Expand All @@ -92,14 +100,14 @@ public static void initCIUS_PT (@Nonnull final IValidationExecutorSetRegistry <I
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CIUS_PT_UBL_CREDITNOTE_200,
"CIUS-PT UBL Credit Note " +
VID_CIUS_PT_UBL_CREDITNOTE_200.getVersionString (),
bDeprecated,
_createStatus (bDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllCreditNoteXSDs ()),
ValidationExecutorSchematron.createXSLT (RES_200,
UBL21NamespaceContext.getInstance ())));
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CIUS_PT_UBL_INVOICE_200,
"CIUS-PT UBL Invoice " +
VID_CIUS_PT_UBL_INVOICE_200.getVersionString (),
bDeprecated,
_createStatus (bDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllInvoiceXSDs ()),
ValidationExecutorSchematron.createXSLT (RES_200,
UBL21NamespaceContext.getInstance ())));
Expand All @@ -108,14 +116,14 @@ public static void initCIUS_PT (@Nonnull final IValidationExecutorSetRegistry <I
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CIUS_PT_UBL_CREDITNOTE_211,
"CIUS-PT UBL Credit Note " +
VID_CIUS_PT_UBL_CREDITNOTE_211.getVersionString (),
bNotDeprecated,
_createStatus (bNotDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllCreditNoteXSDs ()),
ValidationExecutorSchematron.createXSLT (RES_211,
UBL21NamespaceContext.getInstance ())));
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CIUS_PT_UBL_INVOICE_211,
"CIUS-PT UBL Invoice " +
VID_CIUS_PT_UBL_INVOICE_211.getVersionString (),
bNotDeprecated,
_createStatus (bNotDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllInvoiceXSDs ()),
ValidationExecutorSchematron.createXSLT (RES_211,
UBL21NamespaceContext.getInstance ())));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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.en16931.EN16931Validation;
import com.helger.phive.xml.schematron.ValidationExecutorSchematron;
import com.helger.phive.xml.source.IValidationSourceXML;
Expand Down Expand Up @@ -77,6 +79,12 @@ private static ClassLoader _getCL ()
return CIUS_ROValidation.class.getClassLoader ();
}

@Nonnull
private static IValidationExecutorSetStatus _createStatus (final boolean bIsDeprecated)
{
return ValidationExecutorSetStatus.createDeprecatedNow (bIsDeprecated);
}

/**
* Register all standard CIUS-RO validation execution sets to the provided
* registry.
Expand All @@ -96,7 +104,7 @@ public static void initCIUS_RO (@Nonnull final IValidationExecutorSetRegistry <I
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CIUS_RO_UBL_CREDITNOTE_103,
"CIUS-RO UBL Credit Note " +
VID_CIUS_RO_UBL_CREDITNOTE_103.getVersionString (),
bDeprecated,
_createStatus (bDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllCreditNoteXSDs ()),
ValidationExecutorSchematron.createXSLT (EN16931Validation.INVOICE_UBL_137_XSLT,
UBL21NamespaceContext.getInstance ()),
Expand All @@ -105,7 +113,7 @@ public static void initCIUS_RO (@Nonnull final IValidationExecutorSetRegistry <I
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CIUS_RO_UBL_INVOICE_103,
"CIUS-RO UBL Invoice " +
VID_CIUS_RO_UBL_INVOICE_103.getVersionString (),
bDeprecated,
_createStatus (bDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllInvoiceXSDs ()),
ValidationExecutorSchematron.createXSLT (EN16931Validation.INVOICE_UBL_137_XSLT,
UBL21NamespaceContext.getInstance ()),
Expand All @@ -116,7 +124,7 @@ public static void initCIUS_RO (@Nonnull final IValidationExecutorSetRegistry <I
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CIUS_RO_UBL_CREDITNOTE_104,
"CIUS-RO UBL Credit Note " +
VID_CIUS_RO_UBL_CREDITNOTE_104.getVersionString (),
bDeprecated,
_createStatus (bDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllCreditNoteXSDs ()),
ValidationExecutorSchematron.createXSLT (EN16931Validation.INVOICE_UBL_137_XSLT,
UBL21NamespaceContext.getInstance ()),
Expand All @@ -125,7 +133,7 @@ public static void initCIUS_RO (@Nonnull final IValidationExecutorSetRegistry <I
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CIUS_RO_UBL_INVOICE_104,
"CIUS-RO UBL Invoice " +
VID_CIUS_RO_UBL_INVOICE_104.getVersionString (),
bDeprecated,
_createStatus (bDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllInvoiceXSDs ()),
ValidationExecutorSchematron.createXSLT (EN16931Validation.INVOICE_UBL_137_XSLT,
UBL21NamespaceContext.getInstance ()),
Expand All @@ -136,7 +144,7 @@ public static void initCIUS_RO (@Nonnull final IValidationExecutorSetRegistry <I
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CIUS_RO_UBL_CREDITNOTE_108,
"CIUS-RO UBL Credit Note " +
VID_CIUS_RO_UBL_CREDITNOTE_108.getVersionString (),
bNotDeprecated,
_createStatus (bNotDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllCreditNoteXSDs ()),
ValidationExecutorSchematron.createXSLT (EN16931Validation.INVOICE_UBL_138_XSLT,
UBL21NamespaceContext.getInstance ()),
Expand All @@ -145,7 +153,7 @@ public static void initCIUS_RO (@Nonnull final IValidationExecutorSetRegistry <I
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_CIUS_RO_UBL_INVOICE_108,
"CIUS-RO UBL Invoice " +
VID_CIUS_RO_UBL_INVOICE_108.getVersionString (),
bNotDeprecated,
_createStatus (bNotDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllInvoiceXSDs ()),
ValidationExecutorSchematron.createXSLT (EN16931Validation.INVOICE_UBL_138_XSLT,
UBL21NamespaceContext.getInstance ()),
Expand Down
Loading

0 comments on commit 4115790

Please sign in to comment.