Package com.itextpdf.kernel.pdf.tagging
Class StandardNamespaces
- java.lang.Object
-
- com.itextpdf.kernel.pdf.tagging.StandardNamespaces
-
public final class StandardNamespaces extends java.lang.Object
This class encapsulates information about the standard structure namespaces and provides some utility methods connected to them. The main purpose of this class is to determine if the given role in the specified namespace belongs to the standard or known domain-specific namespace.See ISO 32000-2 14.8.6, "Standard structure namespaces"
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MATH_ML
Specifies the name of MathML namespace.static java.lang.String
PDF_1_7
Specifies the name of the standard structure namespace for PDF 1.7static java.lang.String
PDF_2_0
Specifies the name of the standard structure namespace for PDF 2.0private static java.util.Set<java.lang.String>
STD_STRUCT_NAMESPACE_1_7_TYPES
private static java.util.Set<java.lang.String>
STD_STRUCT_NAMESPACE_2_0_TYPES
-
Constructor Summary
Constructors Constructor Description StandardNamespaces()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getDefault()
Gets the name of the default standard structure namespace.static boolean
isHnRole(java.lang.String role)
Checks if the given role matches the Hn role pattern.static boolean
isKnownDomainSpecificNamespace(PdfNamespace namespace)
Checks if the given namespace is identified as the one that is common within broad ranges of documents types and doesn't require a role mapping for its roles.static boolean
roleBelongsToStandardNamespace(java.lang.String role, java.lang.String standardNamespaceName)
Checks if the given role is considered standard in the specified standard namespace.
-
-
-
Field Detail
-
STD_STRUCT_NAMESPACE_1_7_TYPES
private static final java.util.Set<java.lang.String> STD_STRUCT_NAMESPACE_1_7_TYPES
-
STD_STRUCT_NAMESPACE_2_0_TYPES
private static final java.util.Set<java.lang.String> STD_STRUCT_NAMESPACE_2_0_TYPES
-
MATH_ML
public static final java.lang.String MATH_ML
Specifies the name of MathML namespace. MathML is domain-specific namespace defined in PDF 2.0.- See Also:
- Constant Field Values
-
PDF_1_7
public static final java.lang.String PDF_1_7
Specifies the name of the standard structure namespace for PDF 1.7- See Also:
- Constant Field Values
-
PDF_2_0
public static final java.lang.String PDF_2_0
Specifies the name of the standard structure namespace for PDF 2.0- See Also:
- Constant Field Values
-
-
Method Detail
-
getDefault
public static java.lang.String getDefault()
Gets the name of the default standard structure namespace. When a namespace is not explicitly specified for a given structure element or attribute, it shall be assumed to be within this default standard structure namespace. According to ISO 32000-2 default namespace isPDF_1_7
.- Returns:
- the name of the default standard structure namespace.
-
isKnownDomainSpecificNamespace
public static boolean isKnownDomainSpecificNamespace(PdfNamespace namespace)
Checks if the given namespace is identified as the one that is common within broad ranges of documents types and doesn't require a role mapping for its roles.- Parameters:
namespace
- a namespace to be checked, whether it defines a namespace of the known domain specific language- Returns:
true
, if the givenPdfNamespace
belongs to the domain-specific namespace,false
otherwise
-
roleBelongsToStandardNamespace
public static boolean roleBelongsToStandardNamespace(java.lang.String role, java.lang.String standardNamespaceName)
Checks if the given role is considered standard in the specified standard namespace.- Parameters:
role
- a role to be checked if it is standard in the given standard structure namespace.standardNamespaceName
- aString
identifying standard structure namespace against which given role will be checked.- Returns:
- false if the given role doesn't belong to the standard roles of the given standard structure namespace or if the given namespace name is not standard; true otherwise.
-
isHnRole
public static boolean isHnRole(java.lang.String role)
Checks if the given role matches the Hn role pattern. To match this pattern, the given role shall always consist of the uppercase letter "H" and one or more digits, representing an unsigned integer greater than or equal to 1, without leading zeroes or any other prefix or postfix.- Parameters:
role
- aString
that specifies a role to be checked against Hn role pattern.- Returns:
- true if the role matches, false otherwise.
-
-