Coverage Report - javax.faces.render.Renderer
 
Classes in this File Line Coverage Branch Coverage Complexity
Renderer
0%
0/37
0%
0/30
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 javax.faces.render;
 20  
 
 21  
 import java.io.IOException;
 22  
 
 23  
 import javax.faces.component.UIComponent;
 24  
 import javax.faces.context.FacesContext;
 25  
 import javax.faces.convert.ConverterException;
 26  
 
 27  
 /**
 28  
  * see Javadoc of <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
 29  
  * 
 30  
  * @author Manfred Geiler (latest modification by $Author: slessard $)
 31  
  * @version $Revision: 701829 $ $Date: 2008-10-05 12:06:02 -0500 (Sun, 05 Oct 2008) $
 32  
  */
 33  0
 public abstract class Renderer
 34  
 {
 35  
     public void decode(FacesContext context, UIComponent component)
 36  
     {
 37  0
         if (context == null)
 38  0
             throw new NullPointerException("context");
 39  0
         if (component == null)
 40  0
             throw new NullPointerException("component");
 41  0
     }
 42  
 
 43  
     /**
 44  
      * @throws IOException if an input/output error occurs while rendering 
 45  
      */
 46  
     public void encodeBegin(FacesContext context, UIComponent component) throws IOException
 47  
     {
 48  0
         if (context == null)
 49  0
             throw new NullPointerException("context");
 50  0
         if (component == null)
 51  0
             throw new NullPointerException("component");
 52  0
     }
 53  
 
 54  
     /**
 55  
      * Render all children if there are any.
 56  
      * 
 57  
      * Note: this will only be called if getRendersChildren() returns true. A component which has a renderer with
 58  
      * getRendersChildren() set to true will typically contain the rendering logic for its children in this method.
 59  
      * 
 60  
      * @param context
 61  
      * @param component
 62  
      * @throws IOException
 63  
      */
 64  
     public void encodeChildren(FacesContext context, UIComponent component) throws IOException
 65  
     {
 66  0
         if (context == null)
 67  0
             throw new NullPointerException("context");
 68  0
         if (component == null)
 69  0
             throw new NullPointerException("component");
 70  
 
 71  0
         if (component.getChildCount() > 0)
 72  
         {
 73  0
             for (UIComponent child : component.getChildren())
 74  
             {
 75  0
                 if (!child.isRendered())
 76  
                 {
 77  0
                     continue;
 78  
                 }
 79  
 
 80  0
                 child.encodeAll(context);
 81  
             }
 82  
         }
 83  0
     }
 84  
 
 85  
     /**
 86  
      * @throws IOException if an input/output error occurs while rendering 
 87  
      */
 88  
     public void encodeEnd(FacesContext context, UIComponent component) throws IOException
 89  
     {
 90  0
         if (context == null)
 91  0
             throw new NullPointerException("context");
 92  0
         if (component == null)
 93  0
             throw new NullPointerException("component");
 94  0
     }
 95  
 
 96  
     public String convertClientId(FacesContext context, String clientId)
 97  
     {
 98  0
         if (context == null)
 99  0
             throw new NullPointerException("context");
 100  0
         if (clientId == null)
 101  0
             throw new NullPointerException("clientId");
 102  0
         return clientId;
 103  
     }
 104  
 
 105  
     /**
 106  
      * Switch for deciding who renders the children.
 107  
      * 
 108  
      * @return <b>true</b> - if the component takes care of rendering its children. In this case, encodeChildren() ought
 109  
      *         to be called by the rendering controller (e.g., the rendering controller could be the method encodeAll()
 110  
      *         in UIComponent). In the method encodeChildren(), the component should therefore provide all children
 111  
      *         encode logic. <br/> <b>false</b> - if the component does not take care of rendering its children. In this
 112  
      *         case, encodeChildren() should not be called by the rendering controller. Instead, the children-list
 113  
      *         should be retrieved and the children should directly be rendered by the rendering controller one by one.
 114  
      */
 115  
     public boolean getRendersChildren()
 116  
     {
 117  0
         return false;
 118  
     }
 119  
 
 120  
     public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue)
 121  
         throws ConverterException
 122  
     {
 123  0
         if (context == null)
 124  0
             throw new NullPointerException("context");
 125  0
         if (component == null)
 126  0
             throw new NullPointerException("component");
 127  0
         return submittedValue;
 128  
     }
 129  
 
 130  
 }