1 16 package org.apache.cocoon.forms.event; 17 18 import java.util.Iterator ; 19 import java.util.List ; 20 import java.util.Map ; 21 22 import org.apache.commons.lang.enums.ValuedEnum; 23 24 30 public class ProcessingPhase extends ValuedEnum { 31 32 protected ProcessingPhase(String name, int value) { 33 super(name, value); 34 } 35 36 public static final int LOAD_MODEL_VALUE = 0; 37 public static final ProcessingPhase LOAD_MODEL = new ProcessingPhase("Load model", LOAD_MODEL_VALUE); 38 39 public static final int READ_FROM_REQUEST_VALUE = 1; 40 public static final ProcessingPhase READ_FROM_REQUEST = new ProcessingPhase("Read from request", READ_FROM_REQUEST_VALUE); 41 42 public static final int VALIDATE_VALUE = 2; 43 public static final ProcessingPhase VALIDATE = new ProcessingPhase("Validate", VALIDATE_VALUE); 44 45 public static final int SAVE_MODEL_VALUE = 3; 46 public static final ProcessingPhase SAVE_MODEL = new ProcessingPhase("Save model", SAVE_MODEL_VALUE); 47 48 public static ProcessingPhase getEnum(String name) { 49 return (ProcessingPhase) getEnum(ProcessingPhase.class, name); 50 } 51 52 public static ProcessingPhase getEnum(int value) { 53 return (ProcessingPhase) getEnum(ProcessingPhase.class, value); 54 } 55 56 public static Map getEnumMap() { 57 return getEnumMap(ProcessingPhase.class); 58 } 59 60 public static List getEnumList() { 61 return getEnumList(ProcessingPhase.class); 62 } 63 64 public static Iterator iterator() { 65 return iterator(ProcessingPhase.class); 66 } 67 } 68 | Popular Tags |