Move getNamespaceForVersion and getPrefixForVersion to inheriting class.

This commit is contained in:
langfr
2026-03-14 20:04:45 +01:00
parent 56b9099c3c
commit 49624c6bda
4 changed files with 42 additions and 40 deletions

View File

@@ -41,28 +41,6 @@ public class DXExporterFromA1 extends DXExporterFromA3 {
private static boolean isValidA1(DataSource dataSource) throws IOException {
return getPDFAParserValidationResult(PreflightParserHelper.createPreflightParser (dataSource));
}
/***
* internal helper function: get namespace for order-x
* @param ver the delivery-x version
* @return the URN of the namespace
*/
@Override
public String getNamespaceForVersion(int ver) {
// As of late 2022 the Delivery-X standard is not yet published. See specification:
// Die digitale Ablösung des Papier-Lieferscheins, Version 1.1, April 2022
// Chapter 7.1 XMP-Erweiterungsschema für PDF/A-3
// http://docplayer.org/230301085-Der-digitale-lieferschein-dls.html
return "urn:factur-x:pdfa:CrossIndustryDocument:despatchadvice:1p0#";
}
/***
* internal helper: returns the namespace prefix for the given order-x version number
* @param ver the ox version
* @return the namespace prefix as string, without colon
*/
@Override
public String getPrefixForVersion(int ver) {
return "fx";
}
private static boolean getPDFAParserValidationResult(PreflightParser parser) throws IOException {
/*

View File

@@ -129,6 +129,29 @@ public class DXExporterFromA3 extends ZUGFeRDExporterFromA3 {
private boolean attachZUGFeRDHeaders = true;
/***
* internal helper function: get namespace for order-x
* @param ver the delivery-x version
* @return the URN of the namespace
*/
@Override
public String getNamespaceForVersion(int ver) {
// As of late 2022 the Delivery-X standard is not yet published. See specification:
// Die digitale Ablösung des Papier-Lieferscheins, Version 1.1, April 2022
// Chapter 7.1 XMP-Erweiterungsschema für PDF/A-3
// http://docplayer.org/230301085-Der-digitale-lieferschein-dls.html
return "urn:factur-x:pdfa:CrossIndustryDocument:despatchadvice:1p0#";
}
/***
* internal helper: returns the namespace prefix for the given order-x version number
* @param ver the ox version
* @return the namespace prefix as string, without colon
*/
@Override
public String getPrefixForVersion(int ver) {
return "fx";
}
/**
* Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the
* metadata level, this will not e.g. convert graphics to JPG-2000)

View File

@@ -41,24 +41,6 @@ public class OXExporterFromA1 extends OXExporterFromA3 {
private static boolean isValidA1(DataSource dataSource) throws IOException {
return getPDFAParserValidationResult(PreflightParserHelper.createPreflightParser(dataSource));
}
/***
* internal helper function: get namespace for order-x
* @param ver the order-x version
* @return the URN of the namespace
*/
@Override
public String getNamespaceForVersion(int ver) {
return "urn:factur-x:pdfa:CrossIndustryDocument:1p0#";
}
/***
* internal helper: returns the namespace prefix for the given order-x version number
* @param ver the ox version
* @return the namespace prefix as string, without colon
*/
@Override
public String getPrefixForVersion(int ver) {
return "fx";
}
private static boolean getPDFAParserValidationResult(PreflightParser parser) throws IOException {
/*

View File

@@ -129,6 +129,25 @@ public class OXExporterFromA3 extends ZUGFeRDExporterFromA3 {
private boolean attachZUGFeRDHeaders = true;
/***
* internal helper function: get namespace for order-x
* @param ver the order-x version
* @return the URN of the namespace
*/
@Override
public String getNamespaceForVersion(int ver) {
return "urn:factur-x:pdfa:CrossIndustryDocument:1p0#";
}
/***
* internal helper: returns the namespace prefix for the given order-x version number
* @param ver the ox version
* @return the namespace prefix as string, without colon
*/
@Override
public String getPrefixForVersion(int ver) {
return "fx";
}
/**
* Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the
* metadata level, this will not e.g. convert graphics to JPG-2000)