org.araneaframework.backend.list.helper.reader
Class DefaultResultSetColumnReader

java.lang.Object
  extended byorg.araneaframework.backend.list.helper.reader.DefaultResultSetColumnReader
All Implemented Interfaces:
ResultSetColumnReader

public class DefaultResultSetColumnReader
extends Object
implements ResultSetColumnReader

Default implementation of ResultSetColumnReader.

For each Java type the respectful "get" method is used of the ResultSet. For Date an instance of that class is returned (not a Date). If unsupported Java type is used a runtime exception is thrown.

Author:
Jevgeni Kabanov (ekabanov at araneaframework dot org)
See Also:
ResultSetColumnReader

Field Summary
protected static ResultSetColumnReader instance
           
 
Constructor Summary
protected DefaultResultSetColumnReader()
           
 
Method Summary
static ResultSetColumnReader getInstance()
          Returns a Singleton instance of the DefaultResultSetReader.
 Object readFromResultSet(String columnName, ResultSet resultSet, Class javaType)
          Tries to read the same type as is given in the javaType.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

protected static final ResultSetColumnReader instance
Constructor Detail

DefaultResultSetColumnReader

protected DefaultResultSetColumnReader()
Method Detail

getInstance

public static ResultSetColumnReader getInstance()
Returns a Singleton instance of the DefaultResultSetReader.


readFromResultSet

public Object readFromResultSet(String columnName,
                                ResultSet resultSet,
                                Class javaType)
Tries to read the same type as is given in the javaType.

Specified by:
readFromResultSet in interface ResultSetColumnReader
Parameters:
columnName - column in ResultSet.
resultSet - JDBC result set.
javaType - java type to read to.
Returns:
Custom Java Object from the given ResultSet column.