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 int
private int
private int
private int
(package private) final PdfUAValidationContext
private PdfStructElem
private int
private final HashMap
<PdfStructElem, Tuple2<Integer, Integer>> -
Constructor Summary
ConstructorsConstructorDescriptionTableStructElementIterator
(PdfStructElem tableStructElem, PdfUAValidationContext context) Creates a newTableStructElementIterator
instance. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private List
<PdfStructElem> extractAllTrTags
(List<IStructureNode> possibleTrs) private List
<PdfStructElem> private List
<PdfStructElem> extractTableRows
(PdfStructElem table) private void
flattenElements
(PdfStructElem table) int
Gets the number of rows in the body of the table.int
Gets the number of rows in the footer of the table.int
Gets the number of rows in the header of the table.int
getCol()
Gets the column index of current position.int
Gets the colspan of the current positionprivate static int
getColspan
(PdfStructElem structElem) private static int
getIntValueFromAttributes
(PdfStructElem elem, PdfName name) int
Returns the amount of columns the table has.private PdfName
getRole
(IStructureNode node) int
getRow()
Gets the row index of the current position.int
Gets the rowspan of current position.private static int
getRowspan
(PdfStructElem structElem) boolean
hasNext()
Checks if there is a next element in the iteration.next()
Gets the next element in the iteration.private void
setAmountOfCols
(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 newTableStructElementIterator
instance.- 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:
hasNext
in interfaceITableIterator<PdfStructElem>
- Returns:
true
if there is a next element,false
otherwise.
-
next
Gets the next element in the iteration.- Specified by:
next
in interfaceITableIterator<PdfStructElem>
- Returns:
- The next element.
-
getAmountOfRowsBody
public int getAmountOfRowsBody()Gets the number of rows in the body of the table.- Specified by:
getAmountOfRowsBody
in 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:
getAmountOfRowsHeader
in 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:
getNumberOfColumns
in interfaceITableIterator<PdfStructElem>
- Returns:
- the amount of columns
-
getRow
public int getRow()Gets the row index of the current position.- Specified by:
getRow
in interfaceITableIterator<PdfStructElem>
- Returns:
- The row index.
-
getCol
public int getCol()Gets the column index of current position.- Specified by:
getCol
in interfaceITableIterator<PdfStructElem>
- Returns:
- The column index.
-
getRowspan
public int getRowspan()Gets the rowspan of current position.- Specified by:
getRowspan
in interfaceITableIterator<PdfStructElem>
- Returns:
- the rowspan
-
getColspan
public int getColspan()Gets the colspan of the current position- Specified by:
getColspan
in interfaceITableIterator<PdfStructElem>
- Returns:
- the colspan of current position
-
flattenElements
-
getRole
-
extractTableRows
-
build2DRepresentationOfTagTreeStructures
-
setAmountOfCols
-
extractCells
-
getColspan
-
getRowspan
-
getIntValueFromAttributes
-
extractAllTrTags
-