Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update identification schema methods #1484

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public class AXLMainXMPPackage extends AXLXMPPackage implements MainXMPPackage {

public static final String MAIN_XMP_PACKAGE_TYPE = "MainXMPPackage";

public static final String IDENTIFICATION = "Identification";
public static final String PDFA_IDENTIFICATION = "PDFAIdentification";

public static final String UAIDENTIFICATION = "UAIdentification";
public static final String PDFUA_IDENTIFICATION = "PDFUAIdentification";

/**
* Constructs new object
Expand All @@ -65,16 +65,16 @@ public AXLMainXMPPackage(VeraPDFMeta xmpMetadata, boolean isSerializationValid,
@Override
public List<? extends Object> getLinkedObjects(String link) {
switch (link) {
case IDENTIFICATION:
return this.getIdentification();
case UAIDENTIFICATION:
return this.getUAIdentification();
case PDFA_IDENTIFICATION:
return this.getPDFAIdentification();
case PDFUA_IDENTIFICATION:
return this.getPDFUAIdentification();
default:
return super.getLinkedObjects(link);
}
}

private List<AXLPDFUAIdentification> getUAIdentification() {
private List<AXLPDFUAIdentification> getPDFUAIdentification() {
VeraPDFMeta xmpMetadata = this.getXmpMetadata();
if (xmpMetadata != null && xmpMetadata.containsPropertiesFromNamespace(XMPConst.NS_PDFUA_ID)) {
List<AXLPDFUAIdentification> res = new ArrayList<>(1);
Expand All @@ -84,7 +84,7 @@ private List<AXLPDFUAIdentification> getUAIdentification() {
return Collections.emptyList();
}

private List<AXLPDFAIdentification> getIdentification() {
private List<AXLPDFAIdentification> getPDFAIdentification() {
VeraPDFMeta xmpMetadata = this.getXmpMetadata();
if (xmpMetadata != null && xmpMetadata.containsPropertiesFromNamespace(XMPConst.NS_PDFA_ID)) {
List<AXLPDFAIdentification> res = new ArrayList<>(1);
Expand All @@ -94,6 +94,18 @@ private List<AXLPDFAIdentification> getIdentification() {
return Collections.emptyList();
}

@Override
public Boolean getcontainsPDFUAIdentification() {
VeraPDFMeta xmpMetadata = this.getXmpMetadata();
return xmpMetadata != null && xmpMetadata.containsPropertiesFromNamespace(XMPConst.NS_PDFUA_ID);
}

@Override
public Boolean getcontainsPDFAIdentification() {
VeraPDFMeta xmpMetadata = this.getXmpMetadata();
return xmpMetadata != null && xmpMetadata.containsPropertiesFromNamespace(XMPConst.NS_PDFA_ID);
}

@Override
public String getdc_title() {
VeraPDFMeta xmpMetadata = this.getXmpMetadata();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void test() throws URISyntaxException, XMPException, IOException {
VeraPDFMeta meta = VeraPDFMeta.parse(in);
AXLMainXMPPackage pack = new AXLMainXMPPackage(meta, true);
List<? extends org.verapdf.model.baselayer.Object> list = pack
.getLinkedObjects(AXLMainXMPPackage.IDENTIFICATION);
.getLinkedObjects(AXLMainXMPPackage.PDFA_IDENTIFICATION);
assertEquals(this.identificationSchemaNumber, list.size());
if (!list.isEmpty()) {
AXLPDFAIdentification identification = (AXLPDFAIdentification) list
Expand Down
Loading