Clover coverage report - Code Coverage for tapestry-contrib release 4.0-alpha-3
Coverage timestamp: Mon May 16 2005 09:12:41 EDT
file stats: LOC: 78   Methods: 3
NCLOC: 38   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
SqlTableColumn.java 0% 0% 0% 0%
coverage
 1   
 // Copyright 2004, 2005 The Apache Software Foundation
 2   
 //
 3   
 // Licensed under the Apache License, Version 2.0 (the "License");
 4   
 // you may not use this file except in compliance with the License.
 5   
 // You may obtain a copy of the License at
 6   
 //
 7   
 //     http://www.apache.org/licenses/LICENSE-2.0
 8   
 //
 9   
 // Unless required by applicable law or agreed to in writing, software
 10   
 // distributed under the License is distributed on an "AS IS" BASIS,
 11   
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12   
 // See the License for the specific language governing permissions and
 13   
 // limitations under the License.
 14   
 
 15   
 package org.apache.tapestry.contrib.table.model.sql;
 16   
 
 17   
 import java.sql.ResultSet;
 18   
 import java.sql.SQLException;
 19   
 
 20   
 import org.apache.commons.logging.Log;
 21   
 import org.apache.commons.logging.LogFactory;
 22   
 import org.apache.tapestry.contrib.table.model.simple.SimpleTableColumn;
 23   
 
 24   
 /**
 25   
  * 
 26   
  * @author mindbridge
 27   
  */
 28   
 public class SqlTableColumn extends SimpleTableColumn
 29   
 {
 30   
     private static final Log LOG = LogFactory.getLog(SqlTableColumn.class);
 31   
 
 32   
     /**
 33   
      * Creates an SqlTableColumn
 34   
      * @param strSqlField the identifying name of the column and the SQL field it refers to
 35   
      * @param strDisplayName the display name of the column
 36   
      */
 37  0
     public SqlTableColumn(String strSqlField, String strDisplayName)
 38   
     {
 39  0
         super(strSqlField, strDisplayName);
 40   
     }
 41   
 
 42   
     /**
 43   
      * Creates an SqlTableColumn
 44   
      * @param strSqlField the identifying name of the column and the SQL field it refers to
 45   
      * @param strDisplayName the display name of the column
 46   
      * @param bSortable whether the column is sortable
 47   
      */
 48  0
     public SqlTableColumn(
 49   
         String strSqlField,
 50   
         String strDisplayName,
 51   
         boolean bSortable)
 52   
     {
 53  0
         super(strSqlField, strDisplayName, bSortable);
 54   
     }
 55   
 
 56   
     /**
 57   
      * @see org.apache.tapestry.contrib.table.model.simple.SimpleTableColumn#getColumnValue(Object)
 58   
      */
 59  0
     public Object getColumnValue(Object objRow)
 60   
     {
 61  0
         try
 62   
         {
 63  0
             ResultSet objRS = (ResultSet) objRow;
 64  0
             String strColumnName = getColumnName();
 65  0
             Object objValue = objRS.getObject(strColumnName);
 66  0
             if (objValue == null)
 67  0
                 objValue = "";
 68  0
             return objValue;
 69   
         }
 70   
         catch (SQLException e)
 71   
         {
 72  0
             LOG.error("Cannot get the value for column: " + getColumnName(), e);
 73  0
             return "";
 74   
         }
 75   
     }
 76   
 
 77   
 }
 78