KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > faces > taglib > VerbatimTag


1 /*
2  * Copyright 1999-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.cocoon.faces.taglib;
17
18 import org.xml.sax.SAXException JavaDoc;
19
20 import javax.faces.component.UIComponent;
21 import javax.faces.component.UIOutput;
22
23 /**
24  * @version CVS $Id: VerbatimTag.java 55441 2004-10-24 16:14:10Z cziegeler $
25  */

26 public class VerbatimTag extends UIComponentBodyTag {
27
28     protected String JavaDoc getComponentType() {
29         return "javax.faces.Output";
30     }
31
32     protected String JavaDoc getRendererType() {
33         return "javax.faces.Text";
34     }
35
36     protected void setProperties(UIComponent component) {
37         super.setProperties(component);
38         // TODO: VerbatimTag: Implement escape attribute support
39
component.setTransient(true);
40     }
41
42     public void recycle() {
43         super.recycle();
44     }
45
46     public int doAfterBody() throws SAXException JavaDoc {
47         if (content != null) {
48             String JavaDoc value = content.getContent().toString();
49             ((UIOutput)getComponentInstance()).setValue(value);
50         }
51
52         return getDoAfterBody();
53     }
54 }
55
Popular Tags