uk.org.ogsadai.converters.resultset.webrowset
Class WebRowSetResultSetHandler

java.lang.Object
  |
  +--uk.org.ogsadai.converters.resultset.StrategicResultSetHandler
        |
        +--uk.org.ogsadai.converters.resultset.webrowset.WebRowSetResultSetHandler
All Implemented Interfaces:
ResultSetHandler

public class WebRowSetResultSetHandler
extends StrategicResultSetHandler
implements ResultSetHandler

A ResultSetHandler that uses the strategy design pattern and builds an XML WebRowSet representation of a java.sql.ResultSet.

Key columns and maps are not supported at present.

Author:
The OGSA-DAI Project Team.

Field Summary
private  java.lang.String COLEND_TAG
           
private  java.lang.String COLSTART_TAG
           
private static java.lang.String COPYRIGHT_NOTICE
           
private  java.lang.String ROWEND_TAG
           
private  java.lang.String ROWSTART_TAG
           
 
Fields inherited from class uk.org.ogsadai.converters.resultset.StrategicResultSetHandler
 
Constructor Summary
WebRowSetResultSetHandler(java.sql.ResultSet rs)
          Constructs a new handler.
 
Method Summary
 void columnEnd(java.lang.StringBuffer output)
          Write any data corresponding to the end of a new column.
 void columnStart(java.lang.StringBuffer output)
          Write any data corresponding to the start of a new column.
 void footer(java.lang.StringBuffer output)
          Write any footer data.
 void header(java.lang.StringBuffer output, java.sql.ResultSet rs)
          Write any header data to the output stream.
private  java.lang.String metadata(java.sql.ResultSetMetaData metaData)
          Writes the metadata element of a WebRowSet document.
private  java.lang.String properties(java.sql.ResultSet rs)
          Writes the properties element of a WebRowSet document.
 void rowEnd(java.lang.StringBuffer output)
          Write any data corresponding to the end of a row.
 void rowStart(java.lang.StringBuffer output)
          Write any data corresponding to the start of a new row.
 
Methods inherited from class uk.org.ogsadai.converters.resultset.StrategicResultSetHandler
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
field
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values

ROWSTART_TAG

private final java.lang.String ROWSTART_TAG
See Also:
Constant Field Values

ROWEND_TAG

private final java.lang.String ROWEND_TAG
See Also:
Constant Field Values

COLSTART_TAG

private final java.lang.String COLSTART_TAG
See Also:
Constant Field Values

COLEND_TAG

private final java.lang.String COLEND_TAG
See Also:
Constant Field Values
Constructor Detail

WebRowSetResultSetHandler

public WebRowSetResultSetHandler(java.sql.ResultSet rs)
                          throws ResultSetHandlerException
Constructs a new handler.

Parameters:
rs - Result set to convert
Throws:
ResultSetHandlerException - If a problem occurs when accessing the ResultSet.
Method Detail

header

public void header(java.lang.StringBuffer output,
                   java.sql.ResultSet rs)
            throws ResultSetHandlerException
Description copied from interface: ResultSetHandler
Write any header data to the output stream. This will be invoked once by the ResultSetConverter before any other events.

Specified by:
header in interface ResultSetHandler
Parameters:
output - Output string buffer to append data to
rs - ResultSet from which to extract header information.
Throws:
ResultSetHandlerException - If a problem occurs when accessing the ResultSet.

rowStart

public void rowStart(java.lang.StringBuffer output)
Description copied from interface: ResultSetHandler
Write any data corresponding to the start of a new row.

Specified by:
rowStart in interface ResultSetHandler
Parameters:
output - Output string buffer to append data to.

columnStart

public void columnStart(java.lang.StringBuffer output)
Description copied from interface: ResultSetHandler
Write any data corresponding to the start of a new column.

Specified by:
columnStart in interface ResultSetHandler
Parameters:
output - Output string buffer to append data to.

columnEnd

public void columnEnd(java.lang.StringBuffer output)
Description copied from interface: ResultSetHandler
Write any data corresponding to the end of a new column.

Specified by:
columnEnd in interface ResultSetHandler
Parameters:
output - Output string buffer to append data to.

rowEnd

public void rowEnd(java.lang.StringBuffer output)
Description copied from interface: ResultSetHandler
Write any data corresponding to the end of a row.

Specified by:
rowEnd in interface ResultSetHandler
Parameters:
output - Output string buffer to append data to.

footer

public void footer(java.lang.StringBuffer output)
Description copied from interface: ResultSetHandler
Write any footer data.

Specified by:
footer in interface ResultSetHandler
Parameters:
output - Output string buffer to append data to.

properties

private java.lang.String properties(java.sql.ResultSet rs)
                             throws ResultSetHandlerException
Writes the properties element of a WebRowSet document.

Parameters:
rs - Result set.
Returns:
element as a string.
Throws:
ResultSetHandlerException - If a problem occurs when accessing the ResultSet.

metadata

private java.lang.String metadata(java.sql.ResultSetMetaData metaData)
                           throws ResultSetHandlerException
Writes the metadata element of a WebRowSet document.

Parameters:
metaData - ResultSet meta data.
Returns:
element as a string.
Throws:
ResultSetHandlerException - If a problem occurs when accessing the ResultSet.