View Javadoc

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.trinidad.render;
20  
21  import javax.faces.component.UIComponent;
22  import javax.faces.context.FacesContext;
23  import javax.faces.render.Renderer;
24  
25  /**
26   * TraversingRenderer enhances the general component renderer contract, to
27   * control all child component hierarchy traversal and local client id
28   * generation.
29   *
30   */
31  abstract public class ExtendedRenderer extends Renderer
32                                         implements LifecycleRenderer
33  {
34    /**
35     * Indicates that this Renderer takes responsibility for encoding
36     * its child components.
37     *
38     * @return true, always
39     */
40    @Override
41    public final boolean getRendersChildren()
42    {
43      return true;
44    }
45  
46    /**
47     * Decodes a component and its children.
48     *
49     * @param context    the Faces context
50     * @param component  the component to render
51     */
52    @SuppressWarnings("unchecked")
53    public boolean decodeChildren(
54      FacesContext context,
55      UIComponent  component)
56    {
57      return false;
58    }
59  
60    /**
61     * Validates a component and its children.
62     *
63     * @param context    the Faces context
64     * @param component  the component to render
65     */
66    @SuppressWarnings("unchecked")
67    public boolean validateChildren(
68      FacesContext context,
69      UIComponent  component)
70    {
71      return false;
72    }
73  
74    /**
75     * Updates a component and its children.
76     *
77     * @param context    the Faces context
78     * @param component  the component to render
79     */
80    @SuppressWarnings("unchecked")
81    public boolean updateChildren(
82      FacesContext context,
83      UIComponent  component)
84    {
85      return false;
86    }
87  }