Skip to content

Commit

Permalink
Add method getnamespaceAndTag to GFPDStructElem.
Browse files Browse the repository at this point in the history
Fix getcircularMappingExist method
  • Loading branch information
MaximPlusov committed Jun 5, 2024
1 parent 6c18b0e commit b8c8f07
Showing 1 changed file with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
import org.verapdf.model.coslayer.CosUnicodeName;
import org.verapdf.model.pdlayer.PDStructElem;
import org.verapdf.pd.structure.StructureType;
import org.verapdf.pdfa.flavours.PDFAFlavour;
import org.verapdf.pdfa.flavours.PDFFlavours;
import org.verapdf.tools.StaticResources;
import org.verapdf.tools.TaggedPDFConstants;
import org.verapdf.tools.TaggedPDFHelper;

import java.util.*;
import java.util.logging.Level;
Expand Down Expand Up @@ -121,6 +123,15 @@ public String getparentStandardType() {
return null;
}

@Override
public String getnamespaceAndTag() {
StructureType type = ((org.verapdf.pd.structure.PDStructElem)simplePDObject).getStructureType();
if (type != null) {
return (type.getType() != null ? type.getType() : "null") + ":" + (type.getNameSpaceURI() != null ? type.getNameSpaceURI() : "null");
}
return null;
}

@Override
public Boolean getcontainsParent() {
return ((org.verapdf.pd.structure.PDStructElem) simplePDObject).getParent() != null;
Expand Down Expand Up @@ -193,7 +204,17 @@ public String getE() {
@Override
public Boolean getcircularMappingExist() {
StructureType type = ((org.verapdf.pd.structure.PDStructElem)simplePDObject).getStructureType();
return type != null ? StaticResources.getRoleMapHelper().circularMappingExist(type.getType()) : null;
if (type != null) {
if (StaticResources.getRoleMapHelper().circularMappingExist(type.getType())) {
return true;
}
if (PDFFlavours.isPDFSpecification(StaticContainers.getFlavour(), PDFAFlavour.PDFSpecification.ISO_32000_2_0) &&
TaggedPDFHelper.isCircularMappingExist(type)) {
return true;
}
return false;
}
return null;
}

@Override
Expand Down

0 comments on commit b8c8f07

Please sign in to comment.