Class ResourceListRowData
- java.lang.Object
-
- com.ibm.as400.util.servlet.RowData
-
- com.ibm.as400.util.servlet.ResourceListRowData
-
- All Implemented Interfaces:
- java.io.Serializable
public class ResourceListRowData extends RowData implements java.io.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:- null - The name from each Resource's Presentation object are presented in the column.
- Resource attribute IDs - These are defined by the Resource objects that make up the rows data. The corresponding attribute value is presented in the column.
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
-
Fields inherited from class com.ibm.as400.util.servlet.RowData
rowProperties_, rows_
-
-
Constructor Summary
Constructors Constructor and Description ResourceListRowData()
Constructs a default ResourceListRowData object.ResourceListRowData(ResourceList resourceList, java.lang.Object[] columnAttributeIDs)
Constructs a ResourceListRowData object with the specified resourceList and columnAttributeIDs.
-
Method Summary
Methods Modifier and Type Method and Description java.lang.Object[]
getColumnAttributeIDs()
Returns the array of column attribute IDs.RowMetaData
getMetaData()
Returns the metadata.java.lang.Object
getObject(int columnIndex)
Returns the current row's column data specified at columnIndex.java.util.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(java.lang.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
-
-
-
-
Constructor Detail
-
ResourceListRowData
public ResourceListRowData()
Constructs a default ResourceListRowData object.
-
ResourceListRowData
public ResourceListRowData(ResourceList resourceList, java.lang.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 java.lang.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 classRowData
- Returns:
- The metadata.
-
getObject
public java.lang.Object getObject(int columnIndex) throws RowDataException
Returns the current row's column data specified at columnIndex.- Overrides:
getObject
in classRowData
- Parameters:
columnIndex
- The column index (0-based).- Returns:
- The column object.
- Throws:
RowDataException
- If a row data error occurs.
-
getObjectProperties
public java.util.Vector getObjectProperties(int columnIndex)
Returns the data object's property list at the specified columnIndex.- Overrides:
getObjectProperties
in classRowData
- 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.
-
setColumnAttributeIDs
public void setColumnAttributeIDs(java.lang.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
-
-