1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.myfaces.view.facelets.tag.jsf.core;
20
21 import javax.faces.component.UIComponent;
22 import javax.faces.view.facelets.ComponentConfig;
23 import javax.faces.view.facelets.ComponentHandler;
24 import javax.faces.view.facelets.FaceletContext;
25 import javax.faces.view.facelets.TextHandler;
26
27 import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFFaceletTag;
28 import org.apache.myfaces.view.facelets.tag.TagHandlerUtils;
29
30
31
32
33
34
35
36 @JSFFaceletTag(
37 name = "f:verbatim",
38 bodyContent = "empty",
39 tagClass="org.apache.myfaces.taglib.core.VerbatimTag")
40 public final class VerbatimHandler extends ComponentHandler
41 {
42 public VerbatimHandler(ComponentConfig config)
43 {
44 super(config);
45 }
46
47 public void onComponentCreated(FaceletContext ctx, UIComponent c, UIComponent parent)
48 {
49 StringBuffer content = new StringBuffer();
50 for (TextHandler handler : TagHandlerUtils.findNextByType(nextHandler, TextHandler.class))
51 {
52 content.append(handler.getText(ctx));
53 }
54
55 c.getAttributes().put("value", content.toString());
56 c.getAttributes().put("escape", Boolean.FALSE);
57 c.setTransient(true);
58 }
59
60 public void applyNextHandler(FaceletContext ctx, UIComponent c)
61 {
62 }
63 }