Package com.itextpdf.layout.tagging
Class ProhibitedTagRelationsResolver
- java.lang.Object
-
- com.itextpdf.layout.tagging.ProhibitedTagRelationsResolver
-
public class ProhibitedTagRelationsResolver extends java.lang.ObjectThis class is used to resolve prohibited relations between parent and child tags.
-
-
Field Summary
Fields Modifier and Type Field Description private static PdfAllowedTagRelationsallowedRelationsprivate java.util.Map<java.lang.String,java.lang.String>overriddenRolesprivate PdfDocumentpdfDocumentprivate static java.util.List<java.lang.String>rolesToSkipprivate static java.util.Map<java.lang.String,java.lang.String>updateRules17private static java.util.Map<java.lang.String,java.lang.String>updateRules20
-
Constructor Summary
Constructors Constructor Description ProhibitedTagRelationsResolver(PdfDocument pdfDocument)Creates a new instance ofProhibitedTagRelationsResolver.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidexecuteRoleReplacementRule(TaggingHintKey kid, java.lang.String key)private static java.lang.StringgenerateKey(java.lang.String parentRole, java.lang.String childRole)private java.lang.StringgetParentRole(LayoutTaggingHelper helper, TaggingHintKey hintKey, java.util.List<java.lang.String> rolesToSkip)private static booleanisKidNonStructElement(TaggingHintKey kid)voidoverwriteTaggingRule(java.lang.String parentRole, java.lang.String childRole, java.lang.String newRole)Overwrites tagging rule if it already exists.voidrepairTagStructure(LayoutTaggingHelper taggingHelper, IRenderer topRender)Resolves prohibited relations between parent and child tags.private java.lang.StringresolveToFinalRole(LayoutTaggingHelper helper, TaggingHintKey taggingHintKey, boolean isKid)private java.lang.StringresolveToStandardRole(java.lang.String role)
-
-
-
Field Detail
-
updateRules20
private static final java.util.Map<java.lang.String,java.lang.String> updateRules20
-
updateRules17
private static final java.util.Map<java.lang.String,java.lang.String> updateRules17
-
rolesToSkip
private static final java.util.List<java.lang.String> rolesToSkip
-
allowedRelations
private static final PdfAllowedTagRelations allowedRelations
-
pdfDocument
private final PdfDocument pdfDocument
-
overriddenRoles
private final java.util.Map<java.lang.String,java.lang.String> overriddenRoles
-
-
Constructor Detail
-
ProhibitedTagRelationsResolver
public ProhibitedTagRelationsResolver(PdfDocument pdfDocument)
Creates a new instance ofProhibitedTagRelationsResolver.- Parameters:
pdfDocument- the document to be processed.
-
-
Method Detail
-
repairTagStructure
public void repairTagStructure(LayoutTaggingHelper taggingHelper, IRenderer topRender)
Resolves prohibited relations between parent and child tags.- Parameters:
taggingHelper- the tagging helper.topRender- the top renderer.
-
overwriteTaggingRule
public void overwriteTaggingRule(java.lang.String parentRole, java.lang.String childRole, java.lang.String newRole)Overwrites tagging rule if it already exists. Otherwise, adds the new rule.- Parameters:
parentRole- The parent role.childRole- The child role.newRole- The new role the child should have.
-
executeRoleReplacementRule
private void executeRoleReplacementRule(TaggingHintKey kid, java.lang.String key)
-
isKidNonStructElement
private static boolean isKidNonStructElement(TaggingHintKey kid)
-
generateKey
private static java.lang.String generateKey(java.lang.String parentRole, java.lang.String childRole)
-
resolveToFinalRole
private java.lang.String resolveToFinalRole(LayoutTaggingHelper helper, TaggingHintKey taggingHintKey, boolean isKid)
-
getParentRole
private java.lang.String getParentRole(LayoutTaggingHelper helper, TaggingHintKey hintKey, java.util.List<java.lang.String> rolesToSkip)
-
resolveToStandardRole
private java.lang.String resolveToStandardRole(java.lang.String role)
-
-