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

Add getremappedStandardType to GFPDStructElem #626

Merged
merged 1 commit into from
Dec 27, 2023
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 @@ -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();
}
}
Loading