Coverage report

  %line %branch
org.apache.commons.jelly.tags.fmt.SetBundleTag
0% 
0% 

 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.fmt;
 17  
 
 18  
 import org.apache.commons.jelly.JellyTagException;
 19  
 import org.apache.commons.jelly.XMLOutput;
 20  
 import org.apache.commons.jelly.TagSupport;
 21  
 import org.apache.commons.jelly.expression.Expression;
 22  
 import java.util.Locale;
 23  
 
 24  
 /**
 25  
  * Support for tag handlers for <setLocale>, the bundle setting
 26  
  * tag in JSTL.
 27  
  * @author <a href="mailto:willievu@yahoo.com">Willie Vu</a>
 28  
  * @version $Revision: 1.5 $
 29  
  *
 30  
  */
 31  
 public class SetBundleTag extends TagSupport {
 32  
 
 33  
     private String var;
 34  
 
 35  
     private Expression basename;
 36  
 
 37  
     private String scope;
 38  
 
 39  
     /** Creates a new instance of SetBundleTag */
 40  0
     public SetBundleTag() {
 41  0
     }
 42  
 
 43  
     /**
 44  
      * Evaluates this tag after all the tags properties have been initialized.
 45  
      *
 46  
      */
 47  
     public void doTag(XMLOutput output) throws JellyTagException {
 48  0
         Object basenameInput = null;
 49  0
         if (this.basename != null) {
 50  0
             basenameInput = this.basename.evaluate(context);
 51  
         }
 52  
 
 53  0
         LocalizationContext locCtxt = BundleTag.getLocalizationContext(
 54  
             context, (String) basenameInput);
 55  
 
 56  0
         String varname = (var != null) ? class="keyword">var : Config.FMT_LOCALIZATION_CONTEXT;
 57  
 
 58  0
         if (scope != null) {
 59  0
             context.setVariable(varname, scope, locCtxt);
 60  
         }
 61  
         else {
 62  0
             context.setVariable(varname, locCtxt);
 63  
         }
 64  0
     }
 65  
 
 66  
     public void setVar(String var) {
 67  0
         this.var = class="keyword">var;
 68  0
     }
 69  
 
 70  
     public void setBasename(Expression basename) {
 71  0
         this.basename = basename;
 72  0
     }
 73  
 
 74  
     public void setScope(String scope) {
 75  0
         this.scope = scope;
 76  0
     }
 77  
 }

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