1 17 package org.eclipse.emf.codegen.ecore.genmodel; 18 19 import java.util.Arrays ; 20 import java.util.Collections ; 21 import java.util.List ; 22 23 import org.eclipse.emf.common.util.AbstractEnumerator; 24 25 34 public final class GenResourceKind extends AbstractEnumerator 35 { 36 45 public static final int NONE = 0; 46 47 56 public static final int BASIC = 1; 57 58 67 public static final int XMI = 2; 68 69 78 public static final int XML = 3; 79 80 92 public static final GenResourceKind NONE_LITERAL = new GenResourceKind(NONE, "None"); 93 94 106 public static final GenResourceKind BASIC_LITERAL = new GenResourceKind(BASIC, "Basic"); 107 108 120 public static final GenResourceKind XMI_LITERAL = new GenResourceKind(XMI, "XMI"); 121 122 134 public static final GenResourceKind XML_LITERAL = new GenResourceKind(XML, "XML"); 135 136 142 private static final GenResourceKind[] VALUES_ARRAY = 143 new GenResourceKind[] 144 { 145 NONE_LITERAL, 146 BASIC_LITERAL, 147 XMI_LITERAL, 148 XML_LITERAL, 149 }; 150 151 157 public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); 158 159 165 public static GenResourceKind get(String name) 166 { 167 for (int i = 0; i < VALUES_ARRAY.length; ++i) 168 { 169 GenResourceKind result = VALUES_ARRAY[i]; 170 if (result.toString().equals(name)) 171 { 172 return result; 173 } 174 } 175 return null; 176 } 177 178 184 public static GenResourceKind get(int value) 185 { 186 switch (value) 187 { 188 case NONE: return NONE_LITERAL; 189 case BASIC: return BASIC_LITERAL; 190 case XMI: return XMI_LITERAL; 191 case XML: return XML_LITERAL; 192 } 193 return null; 194 } 195 196 202 private GenResourceKind(int value, String name) 203 { 204 super(value, name); 205 } 206 207 } | Popular Tags |