1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package javax.faces.render; |
17 | |
|
18 | |
import java.io.IOException; |
19 | |
import java.util.Iterator; |
20 | |
|
21 | |
import javax.faces.component.UIComponent; |
22 | |
import javax.faces.context.FacesContext; |
23 | |
import javax.faces.convert.ConverterException; |
24 | |
|
25 | |
import org.seasar.framework.util.AssertionUtil; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | 2616 | public abstract class Renderer { |
32 | |
|
33 | |
public void decode(FacesContext context, UIComponent component) { |
34 | 35 | AssertionUtil.assertNotNull("context", context); |
35 | 23 | AssertionUtil.assertNotNull("component", component); |
36 | 11 | } |
37 | |
|
38 | |
public void encodeBegin(FacesContext context, UIComponent component) |
39 | |
throws IOException { |
40 | 433 | AssertionUtil.assertNotNull("context", context); |
41 | 414 | AssertionUtil.assertNotNull("component", component); |
42 | 395 | } |
43 | |
|
44 | |
public void encodeChildren(FacesContext context, UIComponent component) |
45 | |
throws IOException { |
46 | 87 | AssertionUtil.assertNotNull("context", context); |
47 | 64 | AssertionUtil.assertNotNull("component", component); |
48 | 41 | encodeChildren0(context, component); |
49 | 41 | } |
50 | |
|
51 | |
private void encodeChildren0(FacesContext context, UIComponent component) |
52 | |
throws IOException { |
53 | 59 | for (Iterator itr = component.getChildren().iterator(); itr.hasNext();) { |
54 | 23 | UIComponent child = (UIComponent) itr.next(); |
55 | 23 | child.encodeBegin(context); |
56 | 23 | if (child.getRendersChildren()) { |
57 | 5 | child.encodeChildren(context); |
58 | |
} else { |
59 | 18 | encodeChildren0(context, child); |
60 | |
} |
61 | 23 | child.encodeEnd(context); |
62 | 23 | if (context.getResponseComplete()) { |
63 | 1 | break; |
64 | |
} |
65 | |
} |
66 | 59 | } |
67 | |
|
68 | |
public void encodeEnd(FacesContext context, UIComponent component) |
69 | |
throws IOException { |
70 | 22 | AssertionUtil.assertNotNull("context", context); |
71 | 20 | AssertionUtil.assertNotNull("component", component); |
72 | 18 | } |
73 | |
|
74 | |
public String convertClientId(FacesContext context, String clientId) { |
75 | 319 | AssertionUtil.assertNotNull("context", context); |
76 | 293 | AssertionUtil.assertNotNull("clientId", clientId); |
77 | 267 | return clientId; |
78 | |
} |
79 | |
|
80 | |
public boolean getRendersChildren() { |
81 | 403 | return false; |
82 | |
} |
83 | |
|
84 | |
public Object getConvertedValue(FacesContext context, |
85 | |
UIComponent component, Object submittedValue) |
86 | |
throws ConverterException { |
87 | 4 | AssertionUtil.assertNotNull("context", context); |
88 | 2 | AssertionUtil.assertNotNull("component", component); |
89 | 0 | return submittedValue; |
90 | |
} |
91 | |
|
92 | |
} |