Esri Geoportal Server
1.0

com.esri.gpt.control.rest.writer
Class ResultSetWriter

java.lang.Object
  extended by com.esri.gpt.control.rest.writer.ResponseWriter
      extended by com.esri.gpt.control.rest.writer.ResultSetWriter
Direct Known Subclasses:
JsonResultSetWriter, XmlResultSetWriter

public abstract class ResultSetWriter
extends ResponseWriter

Super-class for a rest response writer based upon a JDBC ResultSet.


Field Summary
 
Fields inherited from class com.esri.gpt.control.rest.writer.ResponseWriter
DEFAULT_NEWLINE, DEFAULT_TAB
 
Constructor Summary
ResultSetWriter(Writer underlyingWriter)
          Constructs with an underlying response writer.
 
Method Summary
abstract  void endRow(int depth)
          Ends a row.
abstract  void endRows(int depth)
          Ends a collection of rows.
abstract  void startRow(int depth)
          Starts a row.
abstract  void startRows(int depth)
          Starts a collection of rows.
abstract  void writeCell(String name, Object value, int depth)
          Writes a cell property value.
 void writeResultSet(ResultSet rs, int depth, String[] columnTags)
          Writes a ResultSet to the response.
 
Methods inherited from class com.esri.gpt.control.rest.writer.ResponseWriter
begin, close, flush, getContentType, getNewline, getTab, getUnderlyingWriter, makeTabs, setNewline, setTab, setUnderlyingWriter, wasWrittenTo, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultSetWriter

public ResultSetWriter(Writer underlyingWriter)
Constructs with an underlying response writer.

Parameters:
underlyingWriter - the underlying writer
Method Detail

endRow

public abstract void endRow(int depth)
                     throws IOException
Ends a row.

Parameters:
depth - the indent depth
Throws:
IOException - if an I/O exception occurs

endRows

public abstract void endRows(int depth)
                      throws IOException
Ends a collection of rows.

Parameters:
depth - the indent depth
Throws:
IOException - if an I/O exception occurs

startRow

public abstract void startRow(int depth)
                       throws IOException
Starts a row.

Parameters:
depth - the indent depth
Throws:
IOException - if an I/O exception occurs

startRows

public abstract void startRows(int depth)
                        throws IOException
Starts a collection of rows.

Parameters:
depth - the indent depth
Throws:
IOException - if an I/O exception occurs

writeCell

public abstract void writeCell(String name,
                               Object value,
                               int depth)
                        throws IOException
Writes a cell property value.

Parameters:
name - the property name
value - the property value
depth - the indent depth
Throws:
IOException - if an I/O exception occurs

writeResultSet

public void writeResultSet(ResultSet rs,
                           int depth,
                           String[] columnTags)
                    throws IOException,
                           SQLException
Writes a ResultSet to the response.

Parameters:
rs - the ResultSet
depth - the indent depth
columnTags - optional, the tag names per column
Throws:
IOException - if an I/O exception occurs
SQLException - if an SQL exception occurs

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.