1 7 package org.enhydra.dods.editor.Doml; 8 9 import java.util.Arrays ; 10 import java.util.Collections ; 11 import java.util.List ; 12 13 import org.eclipse.emf.common.util.AbstractEnumerator; 14 15 24 public final class DbVendor extends AbstractEnumerator { 25 34 public static final int STANDARD = 0; 35 36 45 public static final int INSTANT_DB = 1; 46 47 56 public static final int ORACLE = 2; 57 58 67 public static final int INFORMIX = 3; 68 69 78 public static final int MSQL = 4; 79 80 89 public static final int SYBASE = 5; 90 91 100 public static final int POSTGRE_SQL = 6; 101 102 111 public static final int DB2 = 7; 112 113 122 public static final int QED = 8; 123 124 133 public static final int MY_SQL = 9; 134 135 144 public static final int MCKOI_SQL = 10; 145 146 158 public static final DbVendor STANDARD_LITERAL = new DbVendor(STANDARD, "Standard"); 159 160 172 public static final DbVendor INSTANT_DB_LITERAL = new DbVendor(INSTANT_DB, "InstantDB"); 173 174 186 public static final DbVendor ORACLE_LITERAL = new DbVendor(ORACLE, "Oracle"); 187 188 200 public static final DbVendor INFORMIX_LITERAL = new DbVendor(INFORMIX, "Informix"); 201 202 214 public static final DbVendor MSQL_LITERAL = new DbVendor(MSQL, "MSQL"); 215 216 228 public static final DbVendor SYBASE_LITERAL = new DbVendor(SYBASE, "Sybase"); 229 230 242 public static final DbVendor POSTGRE_SQL_LITERAL = new DbVendor(POSTGRE_SQL, "PostgreSQL"); 243 244 256 public static final DbVendor DB2_LITERAL = new DbVendor(DB2, "DB2"); 257 258 270 public static final DbVendor QED_LITERAL = new DbVendor(QED, "QED"); 271 272 284 public static final DbVendor MY_SQL_LITERAL = new DbVendor(MY_SQL, "MySQL"); 285 286 298 public static final DbVendor MCKOI_SQL_LITERAL = new DbVendor(MCKOI_SQL, "MckoiSQL"); 299 300 306 private static final DbVendor[] VALUES_ARRAY = 307 new DbVendor[] { 308 STANDARD_LITERAL, 309 INSTANT_DB_LITERAL, 310 ORACLE_LITERAL, 311 INFORMIX_LITERAL, 312 MSQL_LITERAL, 313 SYBASE_LITERAL, 314 POSTGRE_SQL_LITERAL, 315 DB2_LITERAL, 316 QED_LITERAL, 317 MY_SQL_LITERAL, 318 MCKOI_SQL_LITERAL, 319 }; 320 321 327 public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); 328 329 335 public static DbVendor get(String name) { 336 for (int i = 0; i < VALUES_ARRAY.length; ++i) { 337 DbVendor result = VALUES_ARRAY[i]; 338 if (result.toString().equals(name)) { 339 return result; 340 } 341 } 342 return null; 343 } 344 345 351 public static DbVendor get(int value) { 352 switch (value) { 353 case STANDARD: return STANDARD_LITERAL; 354 case INSTANT_DB: return INSTANT_DB_LITERAL; 355 case ORACLE: return ORACLE_LITERAL; 356 case INFORMIX: return INFORMIX_LITERAL; 357 case MSQL: return MSQL_LITERAL; 358 case SYBASE: return SYBASE_LITERAL; 359 case POSTGRE_SQL: return POSTGRE_SQL_LITERAL; 360 case DB2: return DB2_LITERAL; 361 case QED: return QED_LITERAL; 362 case MY_SQL: return MY_SQL_LITERAL; 363 case MCKOI_SQL: return MCKOI_SQL_LITERAL; 364 } 365 return null; 366 } 367 368 374 private DbVendor(int value, String name) { 375 super(value, name); 376 } 377 378 } | Popular Tags |