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

Fix getStructureTypeStandardStructureType #648

Merged
merged 1 commit into from
Aug 6, 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
2 changes: 1 addition & 1 deletion src/main/java/org/verapdf/pd/structure/PDStructElem.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public static StructureType getStructureTypeStandardStructureType(StructureType
}
if (!PDFFlavour.isFlavourPDFSpecification(flavour, PDFFlavour.PDFSpecification.ISO_32000_2_0) || PDFFlavour.isFlavourFamily(flavour, PDFFlavour.SpecificationFamily.WCAG)) {
if (type != null) {
return new StructureType(ASAtom.getASAtom(
return StructureType.createStructureType(ASAtom.getASAtom(
StaticResources.getRoleMapHelper().getStandardType(type.getType())), type.getNameSpace());
}
}
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/org/verapdf/pd/structure/StructureType.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class StructureType {
private final ASAtom type;
private final PDStructureNameSpace nameSpace;

public StructureType(ASAtom type, PDStructureNameSpace nameSpace) {
private StructureType(ASAtom type, PDStructureNameSpace nameSpace) {
this.type = type;
this.nameSpace = nameSpace;
}
Expand Down Expand Up @@ -62,6 +62,13 @@ public static StructureType createStructureType(COSObject type, COSObject ns) {
return null;
}

public static StructureType createStructureType(ASAtom type, PDStructureNameSpace nameSpace) {
if (type != null) {
return new StructureType(type, nameSpace);
}
return null;
}

public static StructureType createStructureType(ASAtom type) {
if (type != null) {
return new StructureType(type, null);
Expand Down
Loading