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  
24  /**
25   * LifecycleRenderer can be used to enhance the general component-renderer
26   * contract, by letting a renderer take over control of
27   * all child component hierarchy lifecycle phases.  In particular,
28   * the renderer can take over the implementation of
29   * UIComponent.processValidators(), processDecode(), and processUpdates().
30   * (This requires that the component be a subclass of UIXComponentBase.)
31   *
32   */
33  public interface LifecycleRenderer
34  {
35    /**
36     * Decodes a component's children.
37     *
38     * @param context    the Faces context
39     * @param component  the component to render
40     * @return whether the lifecycle was processed;  if returns false,
41     *   the component should continue default processing of the
42     *    Apply Request Values phase.
43     */
44    public boolean decodeChildren(
45      FacesContext context,
46      UIComponent  component);
47  
48    /**
49     * Validates a component's children.
50     *
51     * @param context    the Faces context
52     * @param component  the component to render
53     * @return whether the lifecycle was processed;  if returns false,
54     *   the component should continue default processing of the
55     *    Process Validation phase.
56     */
57    public boolean validateChildren(
58      FacesContext context,
59      UIComponent  component);
60  
61    /**
62     * Updates a component's children.
63     *
64     * @param context    the Faces context
65     * @param component  the component to render
66     * @return whether the lifecycle was processed;  if returns false,
67     *   the component should continue default processing of the
68     *    Update Model phase.
69     */
70    public boolean updateChildren(
71      FacesContext context,
72      UIComponent  component);
73  }