1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
package javax.faces.component.visit; |
20 | |
|
21 | |
import java.io.Serializable; |
22 | |
import java.util.Collection; |
23 | |
import java.util.Iterator; |
24 | |
import java.util.Set; |
25 | |
|
26 | |
import javax.faces.FactoryFinder; |
27 | |
import javax.faces.component.UIComponent; |
28 | |
import javax.faces.context.FacesContext; |
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | 10 | public abstract class VisitContext |
34 | |
{ |
35 | 2 | public static final Collection<String> ALL_IDS = new AllIdsCollection(); |
36 | |
|
37 | |
public static VisitContext createVisitContext(FacesContext context) |
38 | |
{ |
39 | 0 | VisitContextFactory factory |
40 | |
= (VisitContextFactory) FactoryFinder.getFactory(FactoryFinder.VISIT_CONTEXT_FACTORY); |
41 | 0 | return factory.getVisitContext(context, null, null); |
42 | |
} |
43 | |
|
44 | |
public static VisitContext createVisitContext(FacesContext context, Collection<String> ids, Set<VisitHint> hints) |
45 | |
{ |
46 | 2 | VisitContextFactory factory |
47 | |
= (VisitContextFactory) FactoryFinder.getFactory(FactoryFinder.VISIT_CONTEXT_FACTORY); |
48 | 2 | return factory.getVisitContext(context, ids, hints); |
49 | |
} |
50 | |
|
51 | |
public abstract FacesContext getFacesContext(); |
52 | |
|
53 | |
public abstract Set<VisitHint> getHints(); |
54 | |
|
55 | |
public abstract Collection<String> getIdsToVisit(); |
56 | |
|
57 | |
public abstract Collection<String> getSubtreeIdsToVisit(UIComponent component); |
58 | |
|
59 | |
public abstract VisitResult invokeVisitCallback(UIComponent component, VisitCallback callback); |
60 | |
|
61 | 10 | private static class AllIdsCollection implements Collection<String>, Serializable |
62 | |
{ |
63 | |
public boolean add(String e) |
64 | |
{ |
65 | 0 | throw new UnsupportedOperationException(); |
66 | |
} |
67 | |
|
68 | |
public boolean addAll(Collection<? extends String> c) |
69 | |
{ |
70 | 0 | throw new UnsupportedOperationException(); |
71 | |
} |
72 | |
|
73 | |
public void clear() |
74 | |
{ |
75 | 0 | throw new UnsupportedOperationException(); |
76 | |
} |
77 | |
|
78 | |
public boolean contains(Object o) |
79 | |
{ |
80 | 0 | throw new UnsupportedOperationException(); |
81 | |
} |
82 | |
|
83 | |
public boolean containsAll(Collection<?> c) |
84 | |
{ |
85 | 0 | throw new UnsupportedOperationException(); |
86 | |
} |
87 | |
|
88 | |
public boolean isEmpty() |
89 | |
{ |
90 | 8 | return false; |
91 | |
} |
92 | |
|
93 | |
public Iterator<String> iterator() |
94 | |
{ |
95 | 0 | throw new UnsupportedOperationException(); |
96 | |
} |
97 | |
|
98 | |
public boolean remove(Object o) |
99 | |
{ |
100 | 0 | throw new UnsupportedOperationException(); |
101 | |
} |
102 | |
|
103 | |
public boolean removeAll(Collection<?> c) |
104 | |
{ |
105 | 0 | throw new UnsupportedOperationException(); |
106 | |
} |
107 | |
|
108 | |
public boolean retainAll(Collection<?> c) |
109 | |
{ |
110 | 0 | throw new UnsupportedOperationException(); |
111 | |
} |
112 | |
|
113 | |
public int size() |
114 | |
{ |
115 | 0 | throw new UnsupportedOperationException(); |
116 | |
} |
117 | |
|
118 | |
public Object[] toArray() |
119 | |
{ |
120 | 0 | throw new UnsupportedOperationException(); |
121 | |
} |
122 | |
|
123 | |
public <T> T[] toArray(T[] a) |
124 | |
{ |
125 | 0 | throw new UnsupportedOperationException(); |
126 | |
} |
127 | |
} |
128 | |
} |