Coverage Report - org.apache.myfaces.taglib.core.VerbatimTag
 
Classes in this File Line Coverage Branch Coverage Complexity
VerbatimTag
0%
0/18
0%
0/2
0
 
 1  
 /*
 2  
  * Licensed to the Apache Software Foundation (ASF) under one
 3  
  * or more contributor license agreements.  See the NOTICE file
 4  
  * distributed with this work for additional information
 5  
  * regarding copyright ownership.  The ASF licenses this file
 6  
  * to you under the Apache License, Version 2.0 (the
 7  
  * "License"); you may not use this file except in compliance
 8  
  * with the License.  You may obtain a copy of the License at
 9  
  *
 10  
  *   http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing,
 13  
  * software distributed under the License is distributed on an
 14  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 15  
  * KIND, either express or implied.  See the License for the
 16  
  * specific language governing permissions and limitations
 17  
  * under the License.
 18  
  */
 19  
 package org.apache.myfaces.taglib.core;
 20  
 
 21  
 import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspAttribute;
 22  
 import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspTag;
 23  
 import org.apache.myfaces.shared_impl.renderkit.JSFAttr;
 24  
 import org.apache.myfaces.shared_impl.taglib.UIComponentELTagBase;
 25  
 
 26  
 import javax.el.ValueExpression;
 27  
 import javax.faces.component.UIComponent;
 28  
 import javax.faces.component.UIOutput;
 29  
 import javax.servlet.jsp.JspException;
 30  
 import javax.servlet.jsp.tagext.BodyContent;
 31  
 
 32  
 /**
 33  
  * @author Manfred Geiler (latest modification by $Author: lu4242 $)
 34  
  * @version $Revision: 693358 $ $Date: 2008-09-08 22:54:29 -0500 (Mon, 08 Sep 2008) $
 35  
  */
 36  
 @JSFJspTag(name="f:verbatim",bodyContent="JSP")
 37  0
 public class VerbatimTag
 38  
         extends UIComponentELTagBase
 39  
 {
 40  
     //private static final Log log = LogFactory.getLog(VerbatimTag.class);
 41  
 
 42  
     public String getComponentType()
 43  
     {
 44  0
         return "javax.faces.Output";
 45  
     }
 46  
 
 47  
     public String getRendererType()
 48  
     {
 49  0
         return "javax.faces.Text";
 50  
     }
 51  
 
 52  
     // HtmlOutputText attributes
 53  
     private ValueExpression _escape;
 54  
     private ValueExpression _rendered;
 55  
 
 56  
     protected void setProperties(UIComponent component)
 57  
     {
 58  0
         super.setProperties(component);
 59  
 
 60  0
         setBooleanProperty(component, JSFAttr.ESCAPE_ATTR, _escape, Boolean.FALSE);
 61  0
         setBooleanProperty(component, JSFAttr.RENDERED, _rendered, Boolean.TRUE);
 62  
 
 63  
         //No need to save component state
 64  0
         component.setTransient(true);
 65  0
     }
 66  
 
 67  
     /**
 68  
      * If true, generated markup is escaped.  Default:  false.
 69  
      */
 70  
     @JSFJspAttribute(
 71  
             rtexprvalue=true,
 72  
             className="java.lang.Boolean")
 73  
     public void setEscape(ValueExpression escape)
 74  
     {
 75  0
         _escape = escape;
 76  0
     }
 77  
 
 78  
     /**
 79  
      * Flag indicating whether or not this component should be rendered
 80  
      * (during Render Response Phase), or processed on any subsequent
 81  
      * form submit.  The default value for this property is true.
 82  
      */
 83  
     @JSFJspAttribute(
 84  
             rtexprvalue=true,
 85  
             className="java.lang.Boolean")
 86  
     public void setRendered(ValueExpression rendered)
 87  
     {
 88  0
         _rendered = rendered;
 89  0
     }
 90  
     
 91  
     public int doAfterBody() throws JspException
 92  
     {
 93  0
         BodyContent bodyContent = getBodyContent();
 94  0
         if (bodyContent != null)
 95  
         {
 96  0
             UIOutput component = (UIOutput)getComponentInstance();
 97  0
             component.setValue(bodyContent.getString());
 98  0
             bodyContent.clearBody();
 99  
         }
 100  0
         return super.getDoAfterBodyValue();
 101  
     }
 102  
 }