Clover coverage report - Maven Clover report
Coverage timestamp: Thu Aug 24 2006 01:18:17 PDT
file stats: LOC: 101   Methods: 9
NCLOC: 61   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
TableBean.java 0% 0% 0% 0%
coverage
 1    /*
 2    * Copyright 2004 The Apache Software Foundation
 3    *
 4    * Licensed under the Apache License, Version 2.0 (the "License");
 5    * you may not use this file except in compliance with the License.
 6    * You may obtain a copy of the License at
 7    *
 8    * http://www.apache.org/licenses/LICENSE-2.0
 9    *
 10    * Unless required by applicable law or agreed to in writing, software
 11    * distributed under the License is distributed on an "AS IS" BASIS,
 12    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13    * See the License for the specific language governing permissions and
 14    * limitations under the License.
 15    */
 16    package cal;
 17   
 18    import java.beans.*;
 19    import javax.servlet.http.*;
 20    import javax.servlet.*;
 21    import java.util.Hashtable;
 22   
 23    public class TableBean {
 24   
 25    Hashtable table;
 26    JspCalendar JspCal;
 27    Entries entries;
 28    String date;
 29    String name = null;
 30    String email = null;
 31    boolean processError = false;
 32   
 33  0 public TableBean () {
 34  0 this.table = new Hashtable (10);
 35  0 this.JspCal = new JspCalendar ();
 36  0 this.date = JspCal.getCurrentDate ();
 37    }
 38   
 39  0 public void setName (String nm) {
 40  0 this.name = nm;
 41    }
 42   
 43  0 public String getName () {
 44  0 return this.name;
 45    }
 46   
 47  0 public void setEmail (String mail) {
 48  0 this.email = mail;
 49    }
 50   
 51  0 public String getEmail () {
 52  0 return this.email;
 53    }
 54   
 55  0 public String getDate () {
 56  0 return this.date;
 57    }
 58   
 59  0 public Entries getEntries () {
 60  0 return this.entries;
 61    }
 62   
 63  0 public void processRequest (HttpServletRequest request) {
 64   
 65    // Get the name and e-mail.
 66  0 this.processError = false;
 67  0 if (name == null || name.equals("")) setName(request.getParameter ("name"));
 68  0 if (email == null || email.equals("")) setEmail(request.getParameter ("email"));
 69  0 if (name == null || email == null ||
 70    name.equals("") || email.equals("")) {
 71  0 this.processError = true;
 72  0 return;
 73    }
 74   
 75    // Get the date.
 76  0 String dateR = request.getParameter ("date");
 77  0 if (dateR == null) date = JspCal.getCurrentDate ();
 78  0 else if (dateR.equalsIgnoreCase("next")) date = JspCal.getNextDate ();
 79  0 else if (dateR.equalsIgnoreCase("prev")) date = JspCal.getPrevDate ();
 80   
 81  0 entries = (Entries) table.get (date);
 82  0 if (entries == null) {
 83  0 entries = new Entries ();
 84  0 table.put (date, entries);
 85    }
 86   
 87    // If time is provided add the event.
 88  0 String time = request.getParameter("time");
 89  0 if (time != null) entries.processRequest (request, time);
 90    }
 91   
 92  0 public boolean getProcessError () {
 93  0 return this.processError;
 94    }
 95    }
 96   
 97   
 98   
 99   
 100   
 101