Clover coverage report - Maven Clover report
Coverage timestamp: Thu Aug 24 2006 01:18:17 PDT
file stats: LOC: 82   Methods: 7
NCLOC: 45   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
FooTag.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 examples;
 17   
 18    import javax.servlet.jsp.*;
 19    import javax.servlet.jsp.tagext.*;
 20    import java.util.Hashtable;
 21    import java.io.Writer;
 22    import java.io.IOException;
 23   
 24    /**
 25    * Example1: the simplest tag
 26    * Collect attributes and call into some actions
 27    *
 28    * <foo att1="..." att2="...." att3="...." />
 29    */
 30   
 31    public class FooTag
 32    extends ExampleTagBase
 33    {
 34    private String atts[] = new String[3];
 35    int i = 0;
 36   
 37  0 private final void setAtt(int index, String value) {
 38  0 atts[index] = value;
 39    }
 40   
 41  0 public void setAtt1(String value) {
 42  0 setAtt(0, value);
 43    }
 44   
 45  0 public void setAtt2(String value) {
 46  0 setAtt(1, value);
 47    }
 48   
 49  0 public void setAtt3(String value) {
 50  0 setAtt(2, value);
 51    }
 52   
 53    /**
 54    * Process start tag
 55    *
 56    * @return EVAL_BODY_INCLUDE
 57    */
 58  0 public int doStartTag() throws JspException {
 59  0 i = 0;
 60  0 return EVAL_BODY_TAG;
 61    }
 62   
 63  0 public void doInitBody() throws JspException {
 64  0 pageContext.setAttribute("member", atts[i]);
 65  0 i++;
 66    }
 67   
 68  0 public int doAfterBody() throws JspException {
 69  0 try {
 70  0 if (i == 3) {
 71  0 bodyOut.writeOut(bodyOut.getEnclosingWriter());
 72  0 return SKIP_BODY;
 73    } else
 74  0 pageContext.setAttribute("member", atts[i]);
 75  0 i++;
 76  0 return EVAL_BODY_TAG;
 77    } catch (IOException ex) {
 78  0 throw new JspTagException(ex.toString());
 79    }
 80    }
 81    }
 82