1 16 package javax.faces.event; 17 18 import java.util.ArrayList ; 19 import java.util.Collections ; 20 21 32 public class PhaseId { 33 34 public static final javax.faces.event.PhaseId ANY_PHASE; 36 public static final javax.faces.event.PhaseId APPLY_REQUEST_VALUES; 37 public static final javax.faces.event.PhaseId INVOKE_APPLICATION; 38 public static final javax.faces.event.PhaseId PROCESS_VALIDATIONS; 39 public static final javax.faces.event.PhaseId RENDER_RESPONSE; 40 public static final javax.faces.event.PhaseId RESTORE_VIEW; 41 public static final javax.faces.event.PhaseId UPDATE_MODEL_VALUES; 42 public static final java.util.List VALUES; 43 44 static 45 { 46 int i = 0; 47 ArrayList list = new ArrayList (6); 48 49 ANY_PHASE = new PhaseId("ANY_PHASE",i++); 50 list.add(ANY_PHASE); 51 RESTORE_VIEW = new PhaseId("RESTORE_VIEW",i++); 52 list.add(RESTORE_VIEW); 53 APPLY_REQUEST_VALUES = new PhaseId("APPLY_REQUEST_VALUES",i++); 54 list.add(APPLY_REQUEST_VALUES); 55 PROCESS_VALIDATIONS = new PhaseId("PROCESS_VALIDATIONS",i++); 56 list.add(PROCESS_VALIDATIONS); 57 UPDATE_MODEL_VALUES = new PhaseId("UPDATE_MODEL_VALUES",i++); 58 list.add(UPDATE_MODEL_VALUES); 59 INVOKE_APPLICATION = new PhaseId("INVOKE_APPLICATION",i++); 60 list.add(INVOKE_APPLICATION); 61 RENDER_RESPONSE = new PhaseId("RENDER_RESPONSE",i++); 62 list.add(RENDER_RESPONSE); 63 VALUES = Collections.unmodifiableList(list); 64 } 65 66 67 private final String _name; 68 private final int _ordinal; 69 70 public PhaseId(String name, int ordinal) 72 { 73 this._name = name; 74 this._ordinal = ordinal; 75 } 76 77 public int compareTo(Object other) 79 { 80 return _ordinal - ((PhaseId)other)._ordinal; 81 } 82 83 public int getOrdinal() 84 { 85 return _ordinal; 86 } 87 88 public String toString() 89 { 90 return _name + "(" + _ordinal + ")"; 91 } 92 93 } 94 | Popular Tags |