|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.converters.resultset.StrategicResultSetHandler
A ResultSet handler that uses strategy objects to handle the SQL column types occurring within a ResultSet. The handling of other aspects of a ResultSet is deferred to a sub-class.
The class is constructed using a ResultSet
object and
a ColumnStrategyFactory
object. During this process,
the ResultSet meta-data is analysed to determine which SQL column
types are present. The factory is then used to create an
appropriate ColumnStrategy
objects for each column,
and these strategies are used for processing the ResultSet data
during the conversion process.
This class makes use of the strategy and abstract factory design patterns.
ColumnStrategy
,
ColumnStrategyFactory
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE
Copyright statement. |
private ColumnStrategy[] |
mStrategies
Column strategies for each column. |
Constructor Summary | |
StrategicResultSetHandler(java.sql.ResultSet rs,
ColumnStrategyFactory factory)
Creates a new result set handler that will use strategies for handling the result set fields. |
Method Summary | |
void |
field(java.lang.StringBuffer output,
java.sql.ResultSet resultSet,
int column)
Write the data contained in the specified field. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface uk.org.ogsadai.converters.resultset.ResultSetHandler |
columnEnd, columnStart, footer, header, rowEnd, rowStart |
Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private final ColumnStrategy[] mStrategies
Constructor Detail |
public StrategicResultSetHandler(java.sql.ResultSet rs, ColumnStrategyFactory factory) throws ResultSetHandlerException
rs
- ResultSet to handlefactory
- Factory to use for creating column strategies.
ResultSetHandlerException
- If a problem occurs when accessing the ResultSet.Method Detail |
public final void field(java.lang.StringBuffer output, java.sql.ResultSet resultSet, int column) throws ResultSetHandlerException
ResultSetHandler
field
in interface ResultSetHandler
output
- Output string buffer to append data to.resultSet
- ResultSet from which to extract column information.column
- The column number of the field.
ResultSetHandlerException
- If a problem occurs when accessing the ResultSet.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |