Class TableStructElementIterator
java.lang.Object
com.itextpdf.pdfua.checkers.utils.tables.TableStructElementIterator
- All Implemented Interfaces:
ITableIterator<PdfStructElem>
Creates an iterator to iterate over the table structures.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<PdfStructElem> private intprivate intprivate intprivate int(package private) final PdfUAValidationContextprivate PdfStructElemprivate intprivate final HashMap<PdfStructElem, Tuple2<Integer, Integer>> -
Constructor Summary
ConstructorsConstructorDescriptionTableStructElementIterator(PdfStructElem tableStructElem, PdfUAValidationContext context) Creates a newTableStructElementIteratorinstance. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate List<PdfStructElem> extractAllTrTags(List<IStructureNode> possibleTrs) private List<PdfStructElem> private List<PdfStructElem> extractTableRows(PdfStructElem table) private voidflattenElements(PdfStructElem table) intGets the number of rows in the body of the table.intGets the number of rows in the footer of the table.intGets the number of rows in the header of the table.intgetCol()Gets the column index of current position.intGets the colspan of the current positionprivate static intgetColspan(PdfStructElem structElem) private static intgetIntValueFromAttributes(PdfStructElem elem, PdfName name) intReturns the amount of columns the table has.private PdfNamegetRole(IStructureNode node) intgetRow()Gets the row index of the current position.intGets the rowspan of current position.private static intgetRowspan(PdfStructElem structElem) booleanhasNext()Checks if there is a next element in the iteration.next()Gets the next element in the iteration.private voidsetAmountOfCols(List<PdfStructElem> rows)
-
Field Details
-
context
-
all
-
locationCache
-
amountOfCols
private int amountOfCols -
amountOfRowsHeader
private int amountOfRowsHeader -
amountOfRowsBody
private int amountOfRowsBody -
iterIndex
private int iterIndex -
currentValue
-
-
Constructor Details
-
TableStructElementIterator
Creates a newTableStructElementIteratorinstance.- Parameters:
tableStructElem- the root table struct element.context- the validation context.
-
-
Method Details
-
hasNext
public boolean hasNext()Checks if there is a next element in the iteration.- Specified by:
hasNextin interfaceITableIterator<PdfStructElem>- Returns:
trueif there is a next element,falseotherwise
-
next
Gets the next element in the iteration.- Specified by:
nextin interfaceITableIterator<PdfStructElem>- Returns:
- the next element
-
getAmountOfRowsBody
public int getAmountOfRowsBody()Gets the number of rows in the body of the table.- Specified by:
getAmountOfRowsBodyin interfaceITableIterator<PdfStructElem>- Returns:
- the number of rows in the body of the table
-
getAmountOfRowsHeader
public int getAmountOfRowsHeader()Gets the number of rows in the header of the table.- Specified by:
getAmountOfRowsHeaderin interfaceITableIterator<PdfStructElem>- Returns:
- the number of rows in the header of the table
-
getNumberOfColumns
public int getNumberOfColumns()Returns the amount of columns the table has. All rows in a table in UA specification must have the same column count. So return the max column count for correctly generated error messages.- Specified by:
getNumberOfColumnsin interfaceITableIterator<PdfStructElem>- Returns:
- the amount of columns
-
getRow
public int getRow()Gets the row index of the current position.- Specified by:
getRowin interfaceITableIterator<PdfStructElem>- Returns:
- the row index
-
getCol
public int getCol()Gets the column index of current position.- Specified by:
getColin interfaceITableIterator<PdfStructElem>- Returns:
- the column index
-
getRowspan
public int getRowspan()Gets the rowspan of current position.- Specified by:
getRowspanin interfaceITableIterator<PdfStructElem>- Returns:
- the rowspan
-
getColspan
public int getColspan()Gets the colspan of the current position- Specified by:
getColspanin interfaceITableIterator<PdfStructElem>- Returns:
- the colspan of current position
-
flattenElements
-
getRole
-
extractTableRows
-
build2DRepresentationOfTagTreeStructures
-
setAmountOfCols
-
extractCells
-
getColspan
-
getRowspan
-
getIntValueFromAttributes
-
extractAllTrTags
-