1 21 package org.jboss.portal.setup.impl.dl; 22 23 29 public class StatementType 30 { 31 public static final StatementType INSERT = new StatementType("INSERT"); 32 public static final StatementType ALTER = new StatementType("ALTER"); 33 34 private final String m_type; 36 private StatementType(String name) 37 { 38 m_type = name; 39 } 40 41 public String toString() 42 { 43 return m_type; 44 } 45 46 public static StatementType parseString(String typeName) 47 { 48 if (typeName != null) 49 { 50 typeName = typeName.toUpperCase(); 51 } 52 if (INSERT.toString().equals(typeName)) 53 { 54 return INSERT; 55 } 56 else 57 { 58 throw new IllegalArgumentException ("The statement type '" + typeName + "is not supported"); 59 } 60 } 61 } 62 | Popular Tags |