Class PdfAllowedTagRelations


  • public class PdfAllowedTagRelations
    extends java.lang.Object
    This class defines the allowed parent-child relations for the PDF2.0 standard.
    • Field Detail

      • 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

    • 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.