Skip to content

Commit

Permalink
Add getremappedStandardType to GFPDStructElem
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximPlusov committed Dec 25, 2023
1 parent 6a415aa commit de56cc3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@
import org.verapdf.tools.TaggedPDFConstants;
import org.verapdf.tools.TaggedPDFHelper;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.HashSet;
import java.util.Set;
import java.util.*;

/**
* @author Maksim Bezrukov
Expand Down Expand Up @@ -154,15 +150,22 @@ public String getStandardTypeNamespaceURL() {
}

@Override
public Boolean getisRemappedStandardType() {
public String getremappedStandardType() {
if (hasStandardType()) {
StructureType type = ((org.verapdf.pd.structure.PDStructElem)simplePDObject).getStructureType();
if (type == null) {
return false;
return null;
}
if (!type.getType().getValue().equals(standardType)) {
return type.getType().getValue();
}
} else if (standardType != null) {
String standardTypeMap = StaticResources.getRoleMapHelper().getStandardType(ASAtom.getASAtom(standardType));
if (standardTypeMap != null) {
return standardType;
}
return !type.getType().getValue().equals(standardType);
}
return false;
return null;
}

private boolean hasStandardType(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,9 @@ public class GFSENonStandard extends GFPDStructElem implements SENonStandard {
public GFSENonStandard(PDStructElem structElemDictionary, String standardType) {
super(structElemDictionary, standardType, NON_STANDARD_STRUCTURE_ELEMENT_TYPE);
}

@Override
public Boolean getisNotMappedToStandardType() {
return getremappedStandardType() == null && getcircularMappingExist() != true;
}
}

0 comments on commit de56cc3

Please sign in to comment.