KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > aliasbean > AliasBeanRenderer


1 /*
2  * Copyright 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.myfaces.custom.aliasbean;
17
18 import javax.faces.component.UIComponent;
19 import javax.faces.context.FacesContext;
20 import javax.faces.render.Renderer;
21
22 import org.apache.commons.logging.Log;
23 import org.apache.commons.logging.LogFactory;
24
25 /**
26  * @author Sylvain Vieujot (latest modification by $Author: svieujot $)
27  * @version $Revision: 1.2 $ $Date: 2004/11/14 15:06:35 $
28  * $Log: AliasBeanRenderer.java,v $
29  * Revision 1.2 2004/11/14 15:06:35 svieujot
30  * Improve AliasBean to make the alias effective only within the tag body
31  *
32  * Revision 1.1 2004/11/08 20:43:15 svieujot
33  * Add an x:aliasBean component
34  *
35  */

36 public class AliasBeanRenderer extends Renderer {
37     private static final Log log = LogFactory.getLog(AliasBeanRenderer.class);
38
39     public void encodeBegin(FacesContext facesContext, UIComponent uiComponent) {
40         log.debug("encodeBegin");
41
42         AliasBean aliasBean = (AliasBean) uiComponent;
43         aliasBean.makeAlias(facesContext);
44     }
45
46     public void encodeEnd(FacesContext facesContext, UIComponent uiComponent) {
47         log.debug("encodeEnd");
48
49         AliasBean aliasBean = (AliasBean) uiComponent;
50         aliasBean.removeAlias(facesContext);
51     }
52 }
Popular Tags