Coverage report

  %line %branch
org.apache.commons.jelly.tags.core.RemoveTag
89% 
83% 

 1  
 /*
 2  
  * Copyright 2002,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 org.apache.commons.jelly.tags.core;
 17  
 
 18  
 import org.apache.commons.jelly.MissingAttributeException;
 19  
 import org.apache.commons.jelly.TagSupport;
 20  
 import org.apache.commons.jelly.XMLOutput;
 21  
 import org.apache.commons.jelly.expression.Expression;
 22  
 
 23  
 /**
 24  
  * A tag which removes the variable of the given name from the current variable scope.
 25  
  *
 26  
  * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
 27  
  * @version $Revision: 155420 $
 28  
  */
 29  
 public class RemoveTag extends TagSupport {
 30  
 
 31  
     private Expression var;
 32  
 
 33  13
     public RemoveTag() {
 34  13
     }
 35  
 
 36  
     // Tag interface
 37  
     //-------------------------------------------------------------------------
 38  
     public void doTag(XMLOutput output) throws MissingAttributeException {
 39  13
         if (var != null) {
 40  13
             context.removeVariable( var.evaluateAsString(context) );
 41  13
         }
 42  
         else {
 43  0
             throw new MissingAttributeException("var");
 44  
         }
 45  13
     }
 46  
 
 47  
     // Properties
 48  
     //-------------------------------------------------------------------------
 49  
 
 50  
     /**
 51  
      * Sets the name of the variable which will be removed by this tag..
 52  
      */
 53  
     public void setVar(Expression var) {
 54  13
         this.var = class="keyword">var;
 55  13
     }
 56  
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.