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
23 import javax.faces.component.UIComponent;
24 import javax.faces.context.FacesContext;
25 import javax.faces.convert.ConverterException;
26
27
28
29
30
31
32
33 public abstract class Renderer
34 {
35 public void decode(FacesContext context, UIComponent component)
36 {
37 if (context == null)
38 throw new NullPointerException("context");
39 if (component == null)
40 throw new NullPointerException("component");
41 }
42
43
44
45
46 public void encodeBegin(FacesContext context, UIComponent component) throws IOException
47 {
48 if (context == null)
49 throw new NullPointerException("context");
50 if (component == null)
51 throw new NullPointerException("component");
52 }
53
54
55
56
57
58
59
60
61
62
63
64 public void encodeChildren(FacesContext context, UIComponent component) throws IOException
65 {
66 if (context == null)
67 throw new NullPointerException("context");
68 if (component == null)
69 throw new NullPointerException("component");
70
71 if (component.getChildCount() > 0)
72 {
73 for (int i = 0, childCount = component.getChildCount(); i < childCount; i++)
74 {
75 UIComponent child = component.getChildren().get(i);
76 if (!child.isRendered())
77 {
78 continue;
79 }
80
81 child.encodeAll(context);
82 }
83 }
84 }
85
86
87
88
89 public void encodeEnd(FacesContext context, UIComponent component) throws IOException
90 {
91 if (context == null)
92 throw new NullPointerException("context");
93 if (component == null)
94 throw new NullPointerException("component");
95 }
96
97 public String convertClientId(FacesContext context, String clientId)
98 {
99 if (context == null)
100 throw new NullPointerException("context");
101 if (clientId == null)
102 throw new NullPointerException("clientId");
103 return clientId;
104 }
105
106
107
108
109
110
111
112
113
114
115
116 public boolean getRendersChildren()
117 {
118 return false;
119 }
120
121 public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue)
122 throws ConverterException
123 {
124 if (context == null)
125 throw new NullPointerException("context");
126 if (component == null)
127 throw new NullPointerException("component");
128 return submittedValue;
129 }
130
131 }