org.vizzini.ui.table
Class TableDescriptor

java.lang.Object
  extended by org.vizzini.ui.table.TableDescriptor

public class TableDescriptor
extends Object

Provides a table descriptor for a DescribedTable. The column accessor methods ignore invisible columns, with the exception of those methods named "Absolute".

Since:
v0.2
Version:
v0.2
Author:
Jeffrey M. Thompson

Constructor Summary
TableDescriptor(ColumnDescriptor[] columnDescriptors)
          Construct this object.
TableDescriptor(Document document)
          Construct this object, obtaining the column descriptors from the given URL.
TableDescriptor(File file)
          Construct this object, obtaining the column descriptors from the given file.
TableDescriptor(InputStream inputStream)
          Construct this object, obtaining the column descriptors from the given input stream.
TableDescriptor(List columnDescriptors)
          Construct this object.
TableDescriptor(URL url)
          Construct this object, obtaining the column descriptors from the given URL.
 
Method Summary
 Class getColumnClass(int columnIndex)
          Return the class of the given column.
 int getColumnCount()
          Return the number of visible columns.
 int getColumnCountAbsolute()
          Return the number of columns regardless of their visibility.
 ColumnDescriptor getColumnDescriptor(int columnIndex)
          Return the visible column descriptor for the given column.
 ColumnDescriptor getColumnDescriptorAbsolute(int columnIndex)
          Return the visible column descriptor for the given column.
 String getColumnName(int columnIndex)
          Return the column name for the given column.
 String getColumnPropertyName(int columnIndex)
          Return the column property name for the given column.
 boolean isColumnEditable(int columnIndex)
          Return true if the given column is editable.
 void setColumnVisible(int columnIndex, boolean visible)
          Set the column with the given absolute index visible.
 String toString()
          Return a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableDescriptor

public TableDescriptor(ColumnDescriptor[] columnDescriptors)
Construct this object.

Parameters:
columnDescriptors - The column descriptors.
Since:
v0.2

TableDescriptor

public TableDescriptor(List columnDescriptors)
Construct this object.

Parameters:
columnDescriptors - The column descriptors.
Since:
v0.2

TableDescriptor

public TableDescriptor(InputStream inputStream)
                throws ParserConfigurationException,
                       SAXException,
                       IOException
Construct this object, obtaining the column descriptors from the given input stream.

Parameters:
inputStream - The table descriptor XML input stream.
Throws:
ParserConfigurationException
SAXException
IOException
Since:
v0.2

TableDescriptor

public TableDescriptor(File file)
                throws ParserConfigurationException,
                       SAXException,
                       IOException
Construct this object, obtaining the column descriptors from the given file.

Parameters:
file - The table descriptor XML file.
Throws:
ParserConfigurationException
SAXException
IOException
Since:
v0.2

TableDescriptor

public TableDescriptor(URL url)
                throws ParserConfigurationException,
                       SAXException,
                       IOException
Construct this object, obtaining the column descriptors from the given URL.

Parameters:
url - The table descriptor XML URL.
Throws:
ParserConfigurationException
SAXException
IOException
Since:
v0.2

TableDescriptor

public TableDescriptor(Document document)
                throws ParserConfigurationException,
                       SAXException
Construct this object, obtaining the column descriptors from the given URL.

Parameters:
document - Source XML document.
Throws:
ParserConfigurationException
SAXException
Since:
v0.2
Method Detail

getColumnClass

public Class getColumnClass(int columnIndex)
Return the class of the given column.

Parameters:
columnIndex - The index of the visible column of interest.
Since:
v0.2

getColumnCount

public int getColumnCount()
Return the number of visible columns.

Since:
v0.2

getColumnCountAbsolute

public int getColumnCountAbsolute()
Return the number of columns regardless of their visibility.

Since:
v0.2

getColumnDescriptor

public ColumnDescriptor getColumnDescriptor(int columnIndex)
Return the visible column descriptor for the given column.

Parameters:
columnIndex - The index of the visible column of interest.
Since:
v0.2

getColumnDescriptorAbsolute

public ColumnDescriptor getColumnDescriptorAbsolute(int columnIndex)
Return the visible column descriptor for the given column.

Parameters:
columnIndex - The absolute index of the column of interest.
Since:
v0.2

getColumnName

public String getColumnName(int columnIndex)
Return the column name for the given column.

Parameters:
columnIndex - The index of the visible column of interest.
Since:
v0.2

getColumnPropertyName

public String getColumnPropertyName(int columnIndex)
Return the column property name for the given column.

Parameters:
columnIndex - The index of the visible column of interest.
Since:
v0.2

isColumnEditable

public boolean isColumnEditable(int columnIndex)
Return true if the given column is editable.

Parameters:
columnIndex - The index of the visible column of interest.
Since:
v0.2

setColumnVisible

public void setColumnVisible(int columnIndex,
                             boolean visible)
Set the column with the given absolute index visible.

Parameters:
columnIndex - The absolute index of the column of interest.
Since:
v0.2

toString

public String toString()
Return a string representation of this object.

Overrides:
toString in class Object
Since:
v0.2


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02