1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package javax.faces.event;
20
21 import java.util.ArrayList;
22 import java.util.Collections;
23
24
25
26
27
28
29
30 public class PhaseId implements Comparable{
31
32
33 public static final javax.faces.event.PhaseId ANY_PHASE;
34 public static final javax.faces.event.PhaseId APPLY_REQUEST_VALUES;
35 public static final javax.faces.event.PhaseId INVOKE_APPLICATION;
36 public static final javax.faces.event.PhaseId PROCESS_VALIDATIONS;
37 public static final javax.faces.event.PhaseId RENDER_RESPONSE;
38 public static final javax.faces.event.PhaseId RESTORE_VIEW;
39 public static final javax.faces.event.PhaseId UPDATE_MODEL_VALUES;
40 public static final java.util.List VALUES;
41
42 static
43 {
44 int i = 0;
45 ArrayList<PhaseId> list = new ArrayList<PhaseId>(6);
46
47 ANY_PHASE = new PhaseId("ANY_PHASE",i++);
48 list.add(ANY_PHASE);
49 RESTORE_VIEW = new PhaseId("RESTORE_VIEW",i++);
50 list.add(RESTORE_VIEW);
51 APPLY_REQUEST_VALUES = new PhaseId("APPLY_REQUEST_VALUES",i++);
52 list.add(APPLY_REQUEST_VALUES);
53 PROCESS_VALIDATIONS = new PhaseId("PROCESS_VALIDATIONS",i++);
54 list.add(PROCESS_VALIDATIONS);
55 UPDATE_MODEL_VALUES = new PhaseId("UPDATE_MODEL_VALUES",i++);
56 list.add(UPDATE_MODEL_VALUES);
57 INVOKE_APPLICATION = new PhaseId("INVOKE_APPLICATION",i++);
58 list.add(INVOKE_APPLICATION);
59 RENDER_RESPONSE = new PhaseId("RENDER_RESPONSE",i++);
60 list.add(RENDER_RESPONSE);
61 VALUES = Collections.unmodifiableList(list);
62 }
63
64
65 private final String _name;
66 private final int _ordinal;
67
68
69 private PhaseId(String name, int ordinal)
70 {
71 this._name = name;
72 this._ordinal = ordinal;
73 }
74
75
76 public int compareTo(Object other)
77 {
78 return _ordinal - ((PhaseId)other)._ordinal;
79 }
80
81 public int getOrdinal()
82 {
83 return _ordinal;
84 }
85
86 public String toString()
87 {
88 return _name + "(" + _ordinal + ")";
89 }
90
91 }