All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.util.servlet.HTMLTableConverter

java.lang.Object
   |
   +----com.ibm.as400.util.servlet.StringConverter
           |
           +----com.ibm.as400.util.servlet.HTMLTableConverter

public class HTMLTableConverter
extends StringConverter
implements Serializable
The HTMLTableConverter class can be used to convert the data from a RowData object to an array of strings or HTML tables. Each resulting HTML table then can be used by a servlet to display the rowdata to a browser.

HTMLTableConverter objects generate the following events:

The following example creates an HTMLTableConverter object and does the conversion.

  

// Create an HTMLTableConverter object. HTMLTableConverter converter = new HTMLTableConverter();

// Setup the table tag with a maximum of 25 rows/table. HTMLTable table = new HTMLTable(); table.setMaximumTableSize(25); converter.setTable(table);

// Convert the row data.

// Assume the RowData object was created and initialized in a previous step. String[] html = converter.convert(rowdata);


Constructor Index

 o HTMLTableConverter()
Constructs a default HTMLTableConverter object.

Method Index

 o addActionCompletedListener(ActionCompletedListener)
Adds an ActionCompletedListener.
 o addPropertyChangeListener(PropertyChangeListener)
Adds a PropertyChangeListener.
 o addSectionCompletedListener(SectionCompletedListener)
Adds a SectionCompletedListener.
 o addVetoableChangeListener(VetoableChangeListener)
Adds the VetoableChangeListener.
 o convertToTables(RowData)
Converts the row data specified by rowdata into an array of HTMLTable objects.
 o getHeaderHyperlinks()
Returns the table header's hyperlinks.
 o getMaximumTableSize()
Returns the maximum number of rows in a table.
 o getObjectHyperlink(RowData, int)
Returns the object hyperlink for the current row's specified column.
 o getObjectHyperlink(RowData, int, int)
Returns the object's hyperlink at the specified row and column.
 o getTable()
Returns the default HTML table.
 o isUseMetaData()
Indicates whether the table header is created using the metadata.
 o removeActionCompletedListener(ActionCompletedListener)
Removes this ActionCompletedListener from the internal list.
 o removePropertyChangeListener(PropertyChangeListener)
Removes the PropertyChangeListener from the internal list.
 o removeSectionCompletedListener(SectionCompletedListener)
Removes this SectionCompletedListener from the internal list.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes the VetoableChangeListener from the internal list.
 o setHeaderHyperlinks(HTMLHyperlink[])
Sets the table header's hyperlinks.
 o setMaximumTableSize(int)
Sets the maximum number of rows in a table.
 o setObjectHyperlink(RowData, HTMLHyperlink, int)
Sets the object's hyperlink at the specified column within the current row.
 o setObjectHyperlink(RowData, HTMLHyperlink, int, int)
Sets the row object's hyperlink specified by row and column.
 o setTable(HTMLTable)
Sets the default HTML table to be used during conversion.
 o setUseMetaData(boolean)
Sets whether the table header is created using the metadata.

Constructors

 o HTMLTableConverter
 public HTMLTableConverter()
Constructs a default HTMLTableConverter object.

Methods

 o addActionCompletedListener
 public void addActionCompletedListener(ActionCompletedListener listener)
Adds an ActionCompletedListener. The specified ActionCompletedListener's actionCompleted method is called each time the table conversion is complete and all the row data is converted. The ActionCompletedListener object is added to a list of ActionCompletedListeners managed by this class; it can be removed with removeActionCompletedListener.

Parameters:
listener - The ActionCompletedListener.
See Also:
removeActionCompletedListener
 o addPropertyChangeListener
 public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener. The specified PropertyChangeListener's propertyChange method is called each time the value of any bound property is changed.

Parameters:
listener - The PropertyChangeListener.
See Also:
removePropertyChangeListener
 o addSectionCompletedListener
 public void addSectionCompletedListener(SectionCompletedListener listener)
Adds a SectionCompletedListener. The specified SectionCompletedListener's sectionCompleted method is called each time the conversion for a single table is complete. The SectionCompletedListener object is added to an internal list of SectionCompletedListeners; it can be removed with removeSectionCompletedListener.

Parameters:
listener - The SectionCompletedListener.
See Also:
removeSectionCompletedListener
 o addVetoableChangeListener
 public void addVetoableChangeListener(VetoableChangeListener listener)
Adds the VetoableChangeListener. The specified VetoableChangeListener's vetoableChange method is called each time the value of any constrained property is changed.

Parameters:
listener - The VetoableChangeListener.
See Also:
removeVetoableChangeListener
 o convertToTables
 public HTMLTable[] convertToTables(RowData rowdata) throws PropertyVetoException, RowDataException
Converts the row data specified by rowdata into an array of HTMLTable objects.

Parameters:
rowdata - The RowData object that contains the row data.
Returns:
An array of HTMLTable objects.
Throws: PropertyVetoException
If a change is vetoed.
Throws: RowDataException
If a row data error occurs.
 o getHeaderHyperlinks
 public HTMLHyperlink[] getHeaderHyperlinks()
Returns the table header's hyperlinks.

Returns:
The hyperlinks.
 o getMaximumTableSize
 public int getMaximumTableSize()
Returns the maximum number of rows in a table. The default maximum size is 0 (no maximum).

Returns:
The maximum size.
 o getObjectHyperlink
 public HTMLHyperlink getObjectHyperlink(RowData rowdata,
                                         int column)
Returns the object hyperlink for the current row's specified column.

Parameters:
rowdata - The RowData object that contains the data.
column - The column number (0-based).
Returns:
The hyperlink.
 o getObjectHyperlink
 public HTMLHyperlink getObjectHyperlink(RowData rowdata,
                                         int row,
                                         int column)
Returns the object's hyperlink at the specified row and column.

Parameters:
rowdata - The RowData object that contains the data.
row - The row number (0-based).
column - The column number (0-based).
Returns:
The hyperlink.
 o getTable
 public HTMLTable getTable()
Returns the default HTML table.

Returns:
The table.
 o isUseMetaData
 public boolean isUseMetaData()
Indicates whether the table header is created using the metadata. Default value is false (use existing table header).

Returns:
true if the metadata is used; false otherwise.
 o removeActionCompletedListener
 public void removeActionCompletedListener(ActionCompletedListener listener)
Removes this ActionCompletedListener from the internal list. If the ActionCompletedListener is not on the list, nothing is done.

Parameters:
listener - The ActionCompletedListener.
See Also:
addActionCompletedListener
 o removePropertyChangeListener
 public void removePropertyChangeListener(PropertyChangeListener listener)
Removes the PropertyChangeListener from the internal list. If the PropertyChangeListener is not on the list, nothing is done.

Parameters:
listener - The PropertyChangeListener.
See Also:
addPropertyChangeListener
 o removeSectionCompletedListener
 public void removeSectionCompletedListener(SectionCompletedListener listener)
Removes this SectionCompletedListener from the internal list. If the SectionCompletedListener is not on the list, nothing is done.

Parameters:
listener - The SectionCompletedListener.
See Also:
addSectionCompletedListener
 o removeVetoableChangeListener
 public void removeVetoableChangeListener(VetoableChangeListener listener)
Removes the VetoableChangeListener from the internal list. If the VetoableChangeListener is not on the list, nothing is done.

Parameters:
listener - The VetoableChangeListener.
See Also:
addVetoableChangeListener
 o setHeaderHyperlinks
 public void setHeaderHyperlinks(HTMLHyperlink links[]) throws PropertyVetoException
Sets the table header's hyperlinks.

Parameters:
links - The hyperlinks.
Throws: PropertyVetoException
If a change is vetoed.
 o setMaximumTableSize
 public void setMaximumTableSize(int size) throws PropertyVetoException
Sets the maximum number of rows in a table. The default value is 0 (no maximum).

Parameters:
size - The maximum size.
Throws: PropertyVetoException
If a change is vetoed.
 o setObjectHyperlink
 public void setObjectHyperlink(RowData rowdata,
                                HTMLHyperlink link,
                                int column) throws RowDataException
Sets the object's hyperlink at the specified column within the current row. The hyperlink is a property of the data object that can be used to link the data object to an Uniform Resource Identifier (URI).

Parameters:
rowdata - The RowData object that contains the rowdata.
link - The hyperlink tag.
column - The column number (0-based).
Throws: RowDataException
If a row data exception occurs.
 o setObjectHyperlink
 public void setObjectHyperlink(RowData rowdata,
                                HTMLHyperlink link,
                                int row,
                                int column) throws RowDataException
Sets the row object's hyperlink specified by row and column. The hyperlink is a property of the data object that can be used to link the data object to an Uniform Resource Identifier (URI).

Parameters:
rowdata - The RowData object that contains the row data.
link - The hyperlink tag.
row - The row number (0-based).
column - The column number (0-based).
Throws: RowDataException
If a row data exception occurs.
 o setTable
 public void setTable(HTMLTable table) throws PropertyVetoException
Sets the default HTML table to be used during conversion. The default table's column headers must be set. The setUseMetaData method can also be used to set the column headers based on the metadata.

Parameters:
table - The HTML table.
Throws: PropertyVetoException
If the change is vetoed.
See Also:
setUseMetaData
 o setUseMetaData
 public void setUseMetaData(boolean useMetaData)
Sets whether the table header is created using the metadata. Default value is false (use existing table header).

Parameters:
useMetaData - true if the metadata is used; false otherwise.

All Packages  Class Hierarchy  This Package  Previous  Next  Index