org.specrunner.util.xom
Class TableAdapter

java.lang.Object
  extended by org.specrunner.util.xom.NodeHolder
      extended by org.specrunner.util.xom.TableAdapter
All Implemented Interfaces:
INodeHolder

public class TableAdapter
extends NodeHolder

A table adapter to encapsulate XOM API.

Author:
Thiago Santos

Field Summary
protected  List<CellAdapter> captions
          List of caption elements.
protected  List<CellAdapter> cols
          List of col elements.
protected  List<RowAdapter> rows
          The list of rows.
 
Fields inherited from class org.specrunner.util.xom.NodeHolder
attributeValue, node
 
Fields inherited from interface org.specrunner.util.xom.INodeHolder
ATTRIBUTE_ARGUMENT_PREFIX, ATTRIBUTE_COMPARATOR, ATTRIBUTE_CONVERTER, ATTRIBUTE_EVALUATION, ATTRIBUTE_PROPERTY, ATTRIBUTE_VALUE
 
Constructor Summary
TableAdapter(nu.xom.Element node)
          The table element.
 
Method Summary
 CellAdapter getCaption(int i)
          The caption given by that index.
 List<CellAdapter> getCaptions()
          Get captions list.
 int getCaptionsCount()
          The counter of captions.
 String getCaptionsXPath()
          Gets the XPath for captions.
 CellAdapter getCol(int i)
          The col given by that index.
 List<CellAdapter> getCols()
          Get cols list.
 int getColsCount()
          The counter of cols.
 String getColsXPath()
          Gets the XPath for cols.
 RowAdapter getRow(int i)
          The row given by that index.
 int getRowCount()
          The counter of rows.
 List<RowAdapter> getRows()
          The rows list.
 String getRowsXPath()
          Gets the XPath for rows.
 void select(int fixedCols, int colIndex, int columnIndex, int span)
          Filter a table in range of columns.
 
Methods inherited from class org.specrunner.util.xom.NodeHolder
append, append, attributeContains, attributeEquals, detach, getArguments, getArguments, getAttribute, getAttribute, getAttributeValue, getComparator, getComparator, getConverter, getConverter, getNode, getObject, getObject, getQualifiedName, getValue, hasAttribute, hasName, prepend, prepend, removeAttribute, setAttribute, setAttributeValue, setNode, setValue, toString, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cols

protected List<CellAdapter> cols
List of col elements.


captions

protected List<CellAdapter> captions
List of caption elements.


rows

protected List<RowAdapter> rows
The list of rows.

Constructor Detail

TableAdapter

public TableAdapter(nu.xom.Element node)
The table element.

Parameters:
node - The table.
Method Detail

getColsCount

public int getColsCount()
The counter of cols.

Returns:
The number of cols.

getCols

public List<CellAdapter> getCols()
Get cols list.

Returns:
The cols list.

getColsXPath

public String getColsXPath()
Gets the XPath for cols.

Returns:
The cols XPath.

getCol

public CellAdapter getCol(int i)
The col given by that index.

Parameters:
i - The col index.
Returns:
The col.

getCaptionsCount

public int getCaptionsCount()
The counter of captions.

Returns:
The number of captions.

getCaptions

public List<CellAdapter> getCaptions()
Get captions list.

Returns:
The captions list.

getCaptionsXPath

public String getCaptionsXPath()
Gets the XPath for captions.

Returns:
The captions XPath.

getCaption

public CellAdapter getCaption(int i)
The caption given by that index.

Parameters:
i - The caption index.
Returns:
The caption.

getRowCount

public int getRowCount()
The counter of rows.

Returns:
The number of rows.

getRows

public List<RowAdapter> getRows()
The rows list.

Returns:
The rows list.

getRowsXPath

public String getRowsXPath()
Gets the XPath for rows.

Returns:
The rows XPath.

getRow

public RowAdapter getRow(int i)
The row given by that index.

Parameters:
i - The row index.
Returns:
The row.

select

public void select(int fixedCols,
                   int colIndex,
                   int columnIndex,
                   int span)
Filter a table in range of columns.

Parameters:
fixedCols - Fixed columns.
colIndex - Col index.
columnIndex - Columns index.
span - Colspan.


Copyright © 2014. All rights reserved.