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