Class AbstractResultMatrix<T>
- java.lang.Object
-
- com.itextpdf.pdfua.checkers.utils.tables.AbstractResultMatrix<T>
-
- Type Parameters:
T- the type of the cell
- Direct Known Subclasses:
CellResultMatrix,StructTreeResultMatrix
abstract class AbstractResultMatrix<T> extends java.lang.ObjectClass that represents a matrix of cells in a table. It is used to check if the table has valid headers and scopes for the cells.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<T>cellMatrixprivate intcolsprivate PdfUAConformanceconformanceprotected ITableIterator<T>iteratorprivate introws
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractResultMatrix(ITableIterator<T> iterator, PdfUAConformance conformance)Creates a newAbstractResultMatrixinstance.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcheckValidTableTagging()Runs the algorithm to check if the table has valid headers and scopes for the cells.private static <Z> java.util.List<Z>createFixedSizedList(int capacity, java.lang.Object defaultValue)private voiddetermineDefaultScope(int rowIdx, int rowspan, int colIdx, int colspan, java.util.List<java.lang.Boolean> scopeMatrix)(package private) abstract byte[]getElementId(T cell)(package private) abstract java.util.List<byte[]>getHeaders(T cell)private java.lang.StringgetLocationInTable(int row)private intgetNormalizedRow(int row)(package private) abstract java.lang.StringgetRole(T cell)(package private) abstract java.lang.StringgetScope(T cell)private booleanhasValidHeaderIds(T cell, java.util.Set<java.lang.String> knownIds)private <Z> voidsetCell(int row, int rowSpan, int col, int colSpan, java.util.List<Z> arr, Z value)private voidsetColumnValue(int col, int colSpan, java.util.List<java.lang.Boolean> arr, boolean value)private voidsetRowAndColumnValue(int row, int rowSpan, int col, int colSpan, java.util.List<java.lang.Boolean> arr, boolean value)private voidsetRowValue(int row, int rowSpan, java.util.List<java.lang.Boolean> arr, boolean value)private voidvalidateTableCells(java.util.Set<java.lang.String> knownIds, java.util.List<java.lang.Boolean> scopeMatrix, boolean hasUnknownHeaders)
-
-
-
Field Detail
-
iterator
protected final ITableIterator<T> iterator
-
cellMatrix
private final java.util.List<T> cellMatrix
-
rows
private final int rows
-
cols
private final int cols
-
conformance
private final PdfUAConformance conformance
-
-
Constructor Detail
-
AbstractResultMatrix
protected AbstractResultMatrix(ITableIterator<T> iterator, PdfUAConformance conformance)
Creates a newAbstractResultMatrixinstance.- Parameters:
iterator- the iterator that will be used to iterate over the cellsconformance-PdfUAConformanceof the document that is being checked
-
-
Method Detail
-
checkValidTableTagging
public void checkValidTableTagging()
Runs the algorithm to check if the table has valid headers and scopes for the cells.- Throws:
PdfUAConformanceException- if the table doesn't have valid headers and scopes for the cells.
-
getHeaders
abstract java.util.List<byte[]> getHeaders(T cell)
-
getScope
abstract java.lang.String getScope(T cell)
-
getElementId
abstract byte[] getElementId(T cell)
-
getRole
abstract java.lang.String getRole(T cell)
-
determineDefaultScope
private void determineDefaultScope(int rowIdx, int rowspan, int colIdx, int colspan, java.util.List<java.lang.Boolean> scopeMatrix)
-
validateTableCells
private void validateTableCells(java.util.Set<java.lang.String> knownIds, java.util.List<java.lang.Boolean> scopeMatrix, boolean hasUnknownHeaders)
-
getLocationInTable
private java.lang.String getLocationInTable(int row)
-
getNormalizedRow
private int getNormalizedRow(int row)
-
setCell
private <Z> void setCell(int row, int rowSpan, int col, int colSpan, java.util.List<Z> arr, Z value)
-
setRowValue
private void setRowValue(int row, int rowSpan, java.util.List<java.lang.Boolean> arr, boolean value)
-
setColumnValue
private void setColumnValue(int col, int colSpan, java.util.List<java.lang.Boolean> arr, boolean value)
-
setRowAndColumnValue
private void setRowAndColumnValue(int row, int rowSpan, int col, int colSpan, java.util.List<java.lang.Boolean> arr, boolean value)
-
hasValidHeaderIds
private boolean hasValidHeaderIds(T cell, java.util.Set<java.lang.String> knownIds)
-
createFixedSizedList
private static <Z> java.util.List<Z> createFixedSizedList(int capacity, java.lang.Object defaultValue)
-
-