Package com.itextpdf.kernel.pdf.tagutils
Class PdfAllowedTagRelations
- java.lang.Object
-
- com.itextpdf.kernel.pdf.tagutils.PdfAllowedTagRelations
-
public class PdfAllowedTagRelations extends java.lang.Object
This class defines the allowed parent-child relations for the PDF2.0 standard.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACTUAL_CONTENT
protected java.util.Map<java.lang.String,java.util.Collection<java.lang.String>>
allowedParentChildRelations
static java.lang.String
NUMBERED_HEADER
private static java.util.regex.Pattern
numberedHeaderPattern
-
Constructor Summary
Constructors Constructor Description PdfAllowedTagRelations()
Creates a new instance ofPdfAllowedTagRelations
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isContentAllowedInRole(java.lang.String parentRole)
Checks if the given parent role allows content.boolean
isRelationAllowed(java.lang.String parentRole, java.lang.String childRole)
Checks if the given parent-child relation is allowed.java.lang.String
normalizeRole(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:
true
if the relation is allowed,false
otherwise.
-
isContentAllowedInRole
public boolean isContentAllowedInRole(java.lang.String parentRole)
Checks if the given parent role allows content.- Parameters:
parentRole
- The parent role.- Returns:
true
if the parent role allows content,false
otherwise.
-
normalizeRole
public java.lang.String normalizeRole(java.lang.String role)
Normalizes the role.- Parameters:
role
- The role to normalize.- Returns:
- The normalized role.
-
-