com.arsdigita.acs
Class SingleSelection

java.lang.Object
  |
  +--com.arsdigita.acs.SingleSelection
All Implemented Interfaces:
DataSource

public class SingleSelection
extends java.lang.Object
implements DataSource

Represents a single generic object pulled in from the database.


Field Summary
static java.lang.String cvsId
           
 
Constructor Summary
SingleSelection(java.util.Map map)
          Generates a single-row selection from the given Map object.
SingleSelection(java.lang.Object obj)
           
SingleSelection(com.arsdigita.db.SimpleResultSet srs)
          Generates a single-row selection from the current row in the result set.
 
Method Summary
 boolean contains(java.lang.String key)
          Returns true if column is a valid column in this datasource; returns false otherwise.
 java.lang.String get(java.lang.String key)
          Returns the value of the column named by key.
 java.lang.String[] keys()
          Returns a list of valid keys in this datasource, for use with get().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cvsId

public static final java.lang.String cvsId
Constructor Detail

SingleSelection

public SingleSelection(java.lang.Object obj)
                throws java.sql.SQLException

SingleSelection

public SingleSelection(com.arsdigita.db.SimpleResultSet srs)
                throws java.sql.SQLException
Generates a single-row selection from the current row in the result set. Requires that next() has been called at least once on rs.

SingleSelection

public SingleSelection(java.util.Map map)
Generates a single-row selection from the given Map object.
Method Detail

get

public java.lang.String get(java.lang.String key)
                     throws DataSourceException
Returns the value of the column named by key. Returns null if the column value is null.
Specified by:
get in interface DataSource
Throws:
InvalidKeyException - if key is not found.

contains

public boolean contains(java.lang.String key)
                 throws DataSourceException
Description copied from interface: DataSource
Returns true if column is a valid column in this datasource; returns false otherwise.
Specified by:
contains in interface DataSource

keys

public java.lang.String[] keys()
Description copied from interface: DataSource
Returns a list of valid keys in this datasource, for use with get().
Specified by:
keys in interface DataSource