com.ibm.as400.util.servlet
Class ResourceListRowData

java.lang.Object
  extended by com.ibm.as400.util.servlet.RowData
      extended by com.ibm.as400.util.servlet.ResourceListRowData
All Implemented Interfaces:
Serializable

public class ResourceListRowData
extends RowData
implements Serializable

The ResourceListRowData class represents a resource list of data.

The list of data is formatted into a series of rows where each row contains a finite number of columns determined by the number of column attribute ID's. Each column within a row contains an individual data item.

A ResourceListRowData object can represent any implementation of the ResourceList interface. The row data columns are specified as an array of column attribute IDs. The row data will contain a column for each element of the array. The following can be specified as column attribute IDs:

A ResourceListRowData object maintains a position in the resource list that points to its current row of data. The initial position in the list is set before the first row. The next method moves to the next row in the list.

The getObject method is used to retrieve the column value for the current row indexed by the column number. Columns are numbered starting from 0.

The following example creates a ResourceListRowData object using an RUserList:

 

// Create an object to represent the system. AS400 mySystem = new AS400("mySystem.myCompany.com");

// Create a resource user list. RUserList userList = new RUserList(sys);

// Set the selection so that all user profiles // are included in the list. userList.setSelectionValue(RUserList.SELECTION_CRITERIA, RUserList.ALL);

// Create an HTMLTableConverter object. HTMLTableConverter converter = new HTMLTableConverter(); // Set up the table tag with a maximum of 20 rows per table. converter.setMaximumTableSize(20);

// Create an HTMLTable and use the meta data for the table headers. HTMLTable table = new HTMLTable(); table.setCellSpacing(6); table.setBorderWidth(8); converter.setTable(table); converter.setUseMetaData(true);

// Create a ResourceListRowData. ResourceListRowData rowdata = new ResourceListRowData(userList, new Object[] { null, RUser.TEXT_DESCRIPTION } );

// Convert the ResourceListRowData into an HTMLTable. String[] html = converter.convert(rowdata);

// Print out the first table of 20 users from the html array. System.out.println(html[0]);

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
 
Fields inherited from class com.ibm.as400.util.servlet.RowData
rowProperties_, rows_
 
Constructor Summary
Constructor and Description
ResourceListRowData()
          Constructs a default ResourceListRowData object.
ResourceListRowData(ResourceList resourceList, Object[] columnAttributeIDs)
          Constructs a ResourceListRowData object with the specified resourceList and columnAttributeIDs.
 
Method Summary
Modifier and Type Method and Description
 Object[] getColumnAttributeIDs()
          Returns the array of column attribute IDs.
 RowMetaData getMetaData()
          Returns the metadata.
 Object getObject(int columnIndex)
          Returns the current row's column data specified at columnIndex.
 Vector getObjectProperties(int columnIndex)
          Returns the data object's property list at the specified columnIndex.
 ResourceList getResourceList()
          Return the resource list.
 int length()
          Returns the number of rows in the resource list.
 void setColumnAttributeIDs(Object[] columnAttributeIDs)
          Sets the resource list column attribute IDs.
 void setResourceList(ResourceList resourceList)
          Sets the resource list.
 
Methods inherited from class com.ibm.as400.util.servlet.RowData
absolute, addPropertyChangeListener, addVetoableChangeListener, afterLast, beforeFirst, first, getCurrentPosition, getRowProperties, isAfterLast, isBeforeFirst, isFirst, isLast, last, next, previous, relative, removePropertyChangeListener, removeVetoableChangeListener, setObjectProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceListRowData

public ResourceListRowData()
Constructs a default ResourceListRowData object.


ResourceListRowData

public ResourceListRowData(ResourceList resourceList,
                           Object[] columnAttributeIDs)
Constructs a ResourceListRowData object with the specified resourceList and columnAttributeIDs.

Parameters:
resourceList - The resource list.
columnAttributeIDs - The array of column attributes.
See Also:
ResourceList
Method Detail

getColumnAttributeIDs

public Object[] getColumnAttributeIDs()
Returns the array of column attribute IDs.

Returns:
The column attribute IDs.

getMetaData

public RowMetaData getMetaData()
Returns the metadata.

Specified by:
getMetaData in class RowData
Returns:
The metadata.

getObject

public Object getObject(int columnIndex)
                 throws RowDataException
Returns the current row's column data specified at columnIndex.

Overrides:
getObject in class RowData
Parameters:
columnIndex - The column index (0-based).
Returns:
The column object.
Throws:
RowDataException - If a row data error occurs.

getObjectProperties

public Vector getObjectProperties(int columnIndex)
Returns the data object's property list at the specified columnIndex.

Overrides:
getObjectProperties in class RowData
Parameters:
columnIndex - The column index (0-based).
Returns:
The property list for the column data object.
See Also:
RowData.setObjectProperties(java.util.Vector, int)

getResourceList

public ResourceList getResourceList()
Return the resource list.

Returns:
The resource list.

length

public int length()
Returns the number of rows in the resource list.

Overrides:
length in class RowData
Returns:
The number of rows.

setColumnAttributeIDs

public void setColumnAttributeIDs(Object[] columnAttributeIDs)
Sets the resource list column attribute IDs.

Parameters:
columnAttributeIDs - The column attribute IDs.

setResourceList

public void setResourceList(ResourceList resourceList)
Sets the resource list.

Parameters:
resourceList - The resource list.
See Also:
ResourceList