Class TabularDataFactory


public class TabularDataFactory
extends java.lang.Object

Class used to create all forms of Tabular Data such as 2 dimensional arrays and ResultSets have the same interface. This is an example of the Gang of 4 Facade and Factory design patterns. Developers may also check there own types of TabularData into the factory.

View Code

Constructor Summary
protected TabularDataFactory()
Method Summary
 void addTabularDataFactory(java.lang.Class factoryKey, TabularData factory)
static TabularDataFactory createInstance()
          Create a TabularDataFactory
 TabularData getTabularData(java.lang.Object data)
          Return a TabularData object for the passed in Object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


protected TabularDataFactory()
Method Detail


public static TabularDataFactory createInstance()
Create a TabularDataFactory


public void addTabularDataFactory(java.lang.Class factoryKey,
                                  TabularData factory)


public TabularData getTabularData(java.lang.Object data)

Return a TabularData object for the passed in Object. If the passed in object type (or one of its ancestors) is not in the factory then a RuntimeException will be returned.

Sample Call:
 TabularData tabData=TabularDataFactory.createInstance().getTabularData(resultSet);