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 if (context == null) throw new NullPointerException("context");
66 if (component == null) throw new NullPointerException("component");
67
68 if(component.getChildCount()>0) {
69 for (UIComponent child : component.getChildren()) {
70 if (!child.isRendered()) {
71 continue;
72 }
73
74 child.encodeAll(context);
75 }
76 }
77 }
78
79 public void encodeEnd(FacesContext context,
80 UIComponent component)
81 throws IOException
82 {
83 if (context == null) throw new NullPointerException("context");
84 if (component == null) throw new NullPointerException("component");
85 }
86
87 public String convertClientId(FacesContext context,
88 String clientId)
89 {
90 if (context == null) throw new NullPointerException("context");
91 if (clientId == null) throw new NullPointerException("clientId");
92 return clientId;
93 }
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110 public boolean getRendersChildren()
111 {
112 return false;
113 }
114
115 public Object getConvertedValue(FacesContext context,
116 UIComponent component,
117 Object submittedValue)
118 throws ConverterException
119 {
120 if (context == null) throw new NullPointerException("context");
121 if (component == null) throw new NullPointerException("component");
122 return submittedValue;
123 }
124
125 }