1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package javax.faces.render;
20
21 import java.io.IOException;
22 import java.util.List;
23
24 import javax.faces.component.UIComponent;
25 import javax.faces.context.FacesContext;
26 import javax.faces.convert.ConverterException;
27
28
29
30
31
32
33
34 public abstract class Renderer
35 {
36 public void decode(FacesContext context,
37 UIComponent component)
38 {
39 if (context == null) throw new NullPointerException("context");
40 if (component == null) throw new NullPointerException("component");
41 }
42
43 public void encodeBegin(FacesContext context,
44 UIComponent component)
45 throws IOException
46 {
47 if (context == null) throw new NullPointerException("context");
48 if (component == null) throw new NullPointerException("component");
49 }
50
51
52
53
54
55
56
57
58
59
60
61
62 public void encodeChildren(FacesContext context,
63 UIComponent component)
64 throws IOException
65 {
66 if (context == null) throw new NullPointerException("context");
67 if (component == null) throw new NullPointerException("component");
68
69 List children = component.getChildren();
70 for (int i=0; i<children.size(); i++)
71 {
72 UIComponent child = (UIComponent) children.get(i);
73
74 if (!child.isRendered())
75 {
76 continue;
77 }
78
79 child.encodeBegin(context);
80 if (child.getRendersChildren())
81 {
82 child.encodeChildren(context);
83 }
84 else {
85 encodeChildren(context, child);
86 }
87 child.encodeEnd(context);
88 }
89 }
90
91
92 public void encodeEnd(FacesContext context,
93 UIComponent component)
94 throws IOException
95 {
96 if (context == null) throw new NullPointerException("context");
97 if (component == null) throw new NullPointerException("component");
98 }
99
100 public String convertClientId(FacesContext context,
101 String clientId)
102 {
103 if (context == null) throw new NullPointerException("context");
104 if (clientId == null) throw new NullPointerException("clientId");
105 return clientId;
106 }
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123 public boolean getRendersChildren()
124 {
125 return false;
126 }
127
128 public Object getConvertedValue(FacesContext context,
129 UIComponent component,
130 Object submittedValue)
131 throws ConverterException
132 {
133 if (context == null) throw new NullPointerException("context");
134 if (component == null) throw new NullPointerException("component");
135 return submittedValue;
136 }
137
138 }