|
|||||||||
| Home >> All >> com >> meterware >> [ httpunit overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.meterware.httpunit
Class WebTable

java.lang.Objectcom.meterware.httpunit.HTMLElementBase
com.meterware.httpunit.WebTable
- All Implemented Interfaces:
- HTMLElement
- public class WebTable
- extends HTMLElementBase
This class represents a table in an HTML page.
| Field Summary | |
(package private) java.lang.String |
_baseTarget
|
private TableCell[][] |
_cells
|
(package private) java.lang.String |
_characterSet
|
private org.w3c.dom.Element |
_dom
|
(package private) FrameSelector |
_frameName
|
(package private) WebResponse |
_response
|
private java.util.ArrayList |
_rows
|
(package private) java.net.URL |
_url
|
static HTMLElementPredicate |
MATCH_FIRST_NONBLANK_CELL
Predicate to match the complete text of a table's first non-blank cell. |
static HTMLElementPredicate |
MATCH_FIRST_NONBLANK_CELL_PREFIX
Predicate to match a prefix of a table's first non-blank cell. |
static HTMLElementPredicate |
MATCH_ID
Predicate to match a table's ID. |
static HTMLElementPredicate |
MATCH_SUMMARY
Predicate to match a table's summary attribute. |
| Constructor Summary | |
(package private) |
WebTable(WebResponse response,
FrameSelector frame,
org.w3c.dom.Node domTreeRoot,
java.net.URL sourceURL,
java.lang.String baseTarget,
java.lang.String characterSet)
|
| Method Summary | |
(package private) void |
addRow(TableRow tableRow)
|
java.lang.String[][] |
asText()
Returns a rendering of this table with all cells converted to text. |
java.lang.String |
getAttribute(java.lang.String name)
Returns the value of the attribute of this element with the specified name. |
protected java.lang.String |
getAttribute(java.lang.String name,
java.lang.String defaultValue)
|
java.lang.String |
getCellAsText(int row,
int column)
Returns the contents of the specified table cell as text. |
private TableCell[][] |
getCells()
|
java.lang.String |
getClassName()
Returns the class associated with this element. |
int |
getColumnCount()
Returns the number of columns in the table. |
java.lang.String |
getID()
Returns the ID associated with this element. |
java.lang.String |
getName()
Returns the name associated with this element. |
protected org.w3c.dom.Node |
getNode()
|
protected com.meterware.httpunit.scripting.ScriptableDelegate |
getParentDelegate()
Returns the scriptable delegate which can provide the scriptable delegate for this element. |
int |
getRowCount()
Returns the number of rows in the table. |
TableRow[] |
getRows()
|
com.meterware.httpunit.scripting.ScriptableDelegate |
getScriptableDelegate()
Returns a scriptable object which can act as a proxy for this control. |
java.lang.String |
getSummary()
Returns the summary attribute associated with this table. |
TableCell |
getTableCell(int row,
int column)
Returns the contents of the specified table cell as text. |
TableCell |
getTableCellWithID(java.lang.String id)
Returns the contents of the specified table cell with a given ID |
java.lang.String |
getText()
Returns the text value of this block. |
java.lang.String |
getTitle()
Returns the title associated with this element. |
boolean |
isSupportedAttribute(java.lang.String name)
Returns true if this element may have an attribute with the specified name. |
protected com.meterware.httpunit.scripting.ScriptableDelegate |
newScriptable()
Creates and returns a scriptable object for this control. |
(package private) TableRow |
newTableRow(org.w3c.dom.Element element)
|
private void |
placeCell(int row,
int column,
TableCell cell)
|
void |
purgeEmptyCells()
Removes all rows and all columns from this table which have no visible text in them. |
private void |
readTable()
|
protected void |
supportAttribute(java.lang.String name)
|
java.lang.String |
toString()
Convert this Object to a human-readable String. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
MATCH_FIRST_NONBLANK_CELL
public static final HTMLElementPredicate MATCH_FIRST_NONBLANK_CELL
- Predicate to match the complete text of a table's first non-blank cell. *
MATCH_FIRST_NONBLANK_CELL_PREFIX
public static final HTMLElementPredicate MATCH_FIRST_NONBLANK_CELL_PREFIX
- Predicate to match a prefix of a table's first non-blank cell. *
MATCH_SUMMARY
public static final HTMLElementPredicate MATCH_SUMMARY
- Predicate to match a table's summary attribute. *
MATCH_ID
public static final HTMLElementPredicate MATCH_ID
- Predicate to match a table's ID. *
_dom
private org.w3c.dom.Element _dom
_url
java.net.URL _url
_frameName
FrameSelector _frameName
_baseTarget
java.lang.String _baseTarget
_characterSet
java.lang.String _characterSet
_response
WebResponse _response
_cells
private TableCell[][] _cells
_rows
private java.util.ArrayList _rows
| Constructor Detail |
WebTable
WebTable(WebResponse response, FrameSelector frame, org.w3c.dom.Node domTreeRoot, java.net.URL sourceURL, java.lang.String baseTarget, java.lang.String characterSet)
| Method Detail |
getRowCount
public int getRowCount()
- Returns the number of rows in the table.
getCells
private TableCell[][] getCells()
getColumnCount
public int getColumnCount()
- Returns the number of columns in the table.
getCellAsText
public java.lang.String getCellAsText(int row, int column)
- Returns the contents of the specified table cell as text. The row and column numbers are zero-based.
getTableCell
public TableCell getTableCell(int row, int column)
- Returns the contents of the specified table cell as text. The row and column numbers are zero-based.
getTableCellWithID
public TableCell getTableCellWithID(java.lang.String id)
- Returns the contents of the specified table cell with a given ID
purgeEmptyCells
public void purgeEmptyCells()
- Removes all rows and all columns from this table which have no visible text in them.
asText
public java.lang.String[][] asText()
- Returns a rendering of this table with all cells converted to text.
getSummary
public java.lang.String getSummary()
- Returns the summary attribute associated with this table.
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object - Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string concatenation with this object. If the result is
null, string concatenation will instead use"null".The default implementation returns
getClass().getName() + "@" + Integer.toHexString(hashCode()).
newScriptable
protected com.meterware.httpunit.scripting.ScriptableDelegate newScriptable()
- Description copied from class:
HTMLElementBase - Creates and returns a scriptable object for this control. Subclasses should override this if they use a different
implementation of Scriptable.
- Overrides:
newScriptablein classHTMLElementBase
getParentDelegate
protected com.meterware.httpunit.scripting.ScriptableDelegate getParentDelegate()
- Description copied from class:
HTMLElementBase - Returns the scriptable delegate which can provide the scriptable delegate for this element.
- Specified by:
getParentDelegatein classHTMLElementBase
readTable
private void readTable()
placeCell
private void placeCell(int row,
int column,
TableCell cell)
addRow
void addRow(TableRow tableRow)
newTableRow
TableRow newTableRow(org.w3c.dom.Element element)
getRows
public TableRow[] getRows()
getID
public java.lang.String getID()
- Description copied from interface:
HTMLElement - Returns the ID associated with this element. IDs are unique throughout the HTML document.
- Specified by:
getIDin interfaceHTMLElement
getClassName
public java.lang.String getClassName()
- Description copied from interface:
HTMLElement - Returns the class associated with this element.
- Specified by:
getClassNamein interfaceHTMLElement
getTitle
public java.lang.String getTitle()
- Description copied from interface:
HTMLElement - Returns the title associated with this element.
- Specified by:
getTitlein interfaceHTMLElement
getName
public java.lang.String getName()
- Description copied from interface:
HTMLElement - Returns the name associated with this element.
- Specified by:
getNamein interfaceHTMLElement
getScriptableDelegate
public com.meterware.httpunit.scripting.ScriptableDelegate getScriptableDelegate()
- Returns a scriptable object which can act as a proxy for this control.
- Specified by:
getScriptableDelegatein interfaceHTMLElement
getText
public java.lang.String getText()
- Returns the text value of this block.
- Specified by:
getTextin interfaceHTMLElement
getAttribute
public java.lang.String getAttribute(java.lang.String name)
- Description copied from interface:
HTMLElement - Returns the value of the attribute of this element with the specified name.
Returns the empty string if no such attribute exists.
- Specified by:
getAttributein interfaceHTMLElement
isSupportedAttribute
public boolean isSupportedAttribute(java.lang.String name)
- Description copied from interface:
HTMLElement - Returns true if this element may have an attribute with the specified name.
- Specified by:
isSupportedAttributein interfaceHTMLElement
getAttribute
protected java.lang.String getAttribute(java.lang.String name, java.lang.String defaultValue)
getNode
protected org.w3c.dom.Node getNode()
supportAttribute
protected void supportAttribute(java.lang.String name)
|
|||||||||
| Home >> All >> com >> meterware >> [ httpunit overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC