Package com.itextpdf.kernel.pdf.tagutils
Class PdfAllowedTagRelations
- java.lang.Object
-
- com.itextpdf.kernel.pdf.tagutils.PdfAllowedTagRelations
-
public class PdfAllowedTagRelations extends java.lang.ObjectThis class defines the allowed parent-child relations for the PDF2.0 standard.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringACTUAL_CONTENTprotected java.util.Map<java.lang.String,java.util.Collection<java.lang.String>>allowedParentChildRelationsstatic java.lang.StringNUMBERED_HEADERprivate static java.util.regex.PatternnumberedHeaderPattern
-
Constructor Summary
Constructors Constructor Description PdfAllowedTagRelations()Creates a new instance ofPdfAllowedTagRelations.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisContentAllowedInRole(java.lang.String parentRole)Checks if the given parent role allows content.booleanisRelationAllowed(java.lang.String parentRole, java.lang.String childRole)Checks if the given parent-child relation is allowed.java.lang.StringnormalizeRole(java.lang.String role)Normalizes the role.
-
-
-
Field Detail
-
NUMBERED_HEADER
public static final java.lang.String NUMBERED_HEADER
- See Also:
- Constant Field Values
-
ACTUAL_CONTENT
public static final java.lang.String ACTUAL_CONTENT
- See Also:
- Constant Field Values
-
numberedHeaderPattern
private static final java.util.regex.Pattern numberedHeaderPattern
-
allowedParentChildRelations
protected final java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> allowedParentChildRelations
-
-
Constructor Detail
-
PdfAllowedTagRelations
public PdfAllowedTagRelations()
Creates a new instance ofPdfAllowedTagRelations.
-
-
Method Detail
-
isRelationAllowed
public boolean isRelationAllowed(java.lang.String parentRole, java.lang.String childRole)Checks if the given parent-child relation is allowed.- Parameters:
parentRole- The parent role.childRole- The child role.- Returns:
trueif the relation is allowed,falseotherwise.
-
isContentAllowedInRole
public boolean isContentAllowedInRole(java.lang.String parentRole)
Checks if the given parent role allows content.- Parameters:
parentRole- The parent role.- Returns:
trueif the parent role allows content,falseotherwise.
-
normalizeRole
public java.lang.String normalizeRole(java.lang.String role)
Normalizes the role.- Parameters:
role- The role to normalize.- Returns:
- The normalized role.
-
-