From cf72ca3f072ec33653bb39382ac9a6cbf0a6ce69 Mon Sep 17 00:00:00 2001 From: Maxim Date: Thu, 13 Jun 2024 00:03:03 +0300 Subject: [PATCH 1/2] Fix JavaDoc --- .../src/main/java/org/verapdf/gf/foundry/VeraFoundry.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/validation-model/src/main/java/org/verapdf/gf/foundry/VeraFoundry.java b/validation-model/src/main/java/org/verapdf/gf/foundry/VeraFoundry.java index 85fbc8580..cd0e9cf9b 100644 --- a/validation-model/src/main/java/org/verapdf/gf/foundry/VeraFoundry.java +++ b/validation-model/src/main/java/org/verapdf/gf/foundry/VeraFoundry.java @@ -58,7 +58,7 @@ public ComponentDetails getDetails() { } /** - * @see org.verapdf.pdfa.VeraPDFFoundry#newPdfParser(java.io.InputStream) + * @see org.verapdf.pdfa.VeraPDFFoundry#createParser(InputStream) */ @Override public PDFAParser createParser(InputStream pdfStream) throws ModelParsingException, EncryptedPdfException { @@ -66,8 +66,7 @@ public PDFAParser createParser(InputStream pdfStream) throws ModelParsingExcepti } /** - * @see org.verapdf.pdfa.VeraPDFFoundry#newPdfParser(java.io.InputStream, - * org.verapdf.pdfa.flavours.PDFAFlavour) + * @see org.verapdf.pdfa.VeraPDFFoundry#createParser(InputStream, PDFAFlavour) */ @Override public PDFAParser createParser(InputStream pdfStream, PDFAFlavour flavour) @@ -127,7 +126,7 @@ public PDFAParser createParser(File file) } /** - * @see org.verapdf.pdfa.VeraPDFFoundry#newMetadataFixer(org.verapdf.metadata.fixer.utils.FixerConfig) + * @see VeraPDFFoundry#createMetadataFixer() */ @Override public MetadataFixer createMetadataFixer() { From f0787bad42efd40b75f1d92222fbd18681656a0b Mon Sep 17 00:00:00 2001 From: Maxim Date: Wed, 26 Jun 2024 23:01:06 +0300 Subject: [PATCH 2/2] Update GFPDExtGState methods --- .../gf/model/impl/pd/GFPDExtGState.java | 57 +++++++++---------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/GFPDExtGState.java b/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/GFPDExtGState.java index 1d3321f54..26fa2f95e 100644 --- a/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/GFPDExtGState.java +++ b/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/GFPDExtGState.java @@ -60,26 +60,6 @@ public GFPDExtGState(org.verapdf.pd.PDExtGState state) { super(state, EXT_G_STATE_TYPE); } - @Override - public String getTR() { - return getStringProperty(((org.verapdf.pd.PDExtGState) simplePDObject).getCOSTR()); - } - - @Override - public String getTR2() { - return getStringProperty(((org.verapdf.pd.PDExtGState) simplePDObject).getCOSTR2()); - } - - @Override - public String getSMask() { - return getStringProperty(((org.verapdf.pd.PDExtGState) simplePDObject).getCOSSMask()); - } - - @Override - public String getBM() { - return getStringProperty(((org.verapdf.pd.PDExtGState) simplePDObject).getCOSBM()); - } - private List getlinkBM() { COSObject BM = ((org.verapdf.pd.PDExtGState)simplePDObject).getCOSBM(); if (BM == null || BM.empty() || BM.getType() == COSObjType.COS_NULL) { @@ -130,17 +110,19 @@ public Double getCA() { return 2.0; // check is failed } - private static String getStringProperty(COSObject property) { - if (property == null - || property.empty() - || property.getType() == COSObjType.COS_NULL) { - return null; - } + @Override + public String getTR2NameValue() { + return simplePDObject.getNameKeyStringValue(ASAtom.TR2); + } - if (property.getType() == COSObjType.COS_NAME) { - return property.getName().getValue(); - } - return property.toString(); + @Override + public Boolean getcontainsTR() { + return simplePDObject.knownKey(ASAtom.TR); + } + + @Override + public Boolean getcontainsTR2() { + return simplePDObject.knownKey(ASAtom.TR2); } @Override @@ -153,6 +135,21 @@ public Boolean getcontainsHTO() { return this.simplePDObject.knownKey(ASAtom.HTO); } + @Override + public String getSMaskNameValue() { + return simplePDObject.getNameKeyStringValue(ASAtom.SMASK); + } + + @Override + public Boolean getcontainsSMask() { + return simplePDObject.knownKey(ASAtom.SMASK); + } + + @Override + public String getBMNameValue() { + return simplePDObject.getNameKeyStringValue(ASAtom.BM); + } + @Override public List getLinkedObjects(String link) { switch (link) {