Name

ArrayDataModel

Synopsis

This class wraps an array to expose it as a DataModel for a UIData component.

Class name:

javax.faces.model.ArrayDataModel

Extends:

javax.faces.model.DataModel

Implements:

None

Constructors

public ArrayDataModel()

Creates a new, empty instance.

public ArrayDataModel(Object[] array)

Creates a new instance wrapping an array.

Methods

public int getRowCount()

Returns the number of elements in the array or -1 if the array isn’t set.

public Object getRowData()

Returns the array element for the current row index or null if the array isn’t set or there’s no such element.

public int getRowIndex()

Returns the zero-based index for the current row or -1 if no row is selected.

public Object getWrappedData()

Returns the array, or null if the array isn’t set.

public boolean isRowAvailable()

Returns true if the array is set and the current row index is between 0 and the last index of the array.

public void setRowIndex(int index)

Sets the zero-based index for the current row or to -1 if no row is selected.

public void setWrappedData(Object data)

Sets the array.

Get JavaServer Faces now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.