Class PdfUAValidationContext
java.lang.Object
com.itextpdf.pdfua.checkers.utils.PdfUAValidationContext
This class keeps track of useful information when validating a PdfUaDocument. It also contains some useful utility functions that help with PDF UA validation.
-
Constructor Summary
ConstructorDescriptionPdfUAValidationContext
(PdfDocument pdfDocument) Creates a new instance ofPdfUAValidationContext
. -
Method Summary
Modifier and TypeMethodDescriptiongetElementIfRoleMatches
(PdfName role, IStructureNode structureNode) Checks if aIStructureNode
resolved role's is equal to the provided role.Resolves the node's role to a standard role.resolveToStandardRole
(String role) Resolves the role to a standard role
-
Constructor Details
-
PdfUAValidationContext
Creates a new instance ofPdfUAValidationContext
.- Parameters:
-
pdfDocument
- The pdfDocument where the validation is happening.
-
-
Method Details
-
resolveToStandardRole
Resolves the node's role to a standard role.- Parameters:
-
node
- The node you want to resolve the standard role for. - Returns:
- The role.
-
resolveToStandardRole
Resolves the role to a standard role- Parameters:
-
role
- The role you want to resolve the standard role for. - Returns:
- The role.
-
getElementIfRoleMatches
Checks if aIStructureNode
resolved role's is equal to the provided role.Note: This method will not check recursive mapping. So either the node's role is the provided role, or the standard role is the provided role. So we do not take into account the roles in between the mappings.
- Parameters:
-
role
- The role we want to check against. -
structureNode
- The structure node we want to check. - Returns:
-
The
PdfStructElem
if the role matches.
-