1 21 package org.jboss.portal.setup.sl; 22 23 import org.jboss.portal.setup.PortalSetupException; 24 25 31 public class SchemaLoadType 32 { 33 public static final SchemaLoadType NEWONLY = new SchemaLoadType("new-only"); 34 35 public static final SchemaLoadType ALWAYS = new SchemaLoadType("ALWAYS"); 36 public static final SchemaLoadType NEVER = new SchemaLoadType("NEVER"); 37 public static final SchemaLoadType UPDATE = new SchemaLoadType("UPDATE"); 38 39 private final String m_type; 41 private SchemaLoadType(String name) 42 { 43 m_type = name; 44 } 45 46 public String toString() 47 { 48 return m_type; 49 } 50 51 static public SchemaLoadType parseString(String typeName) throws PortalSetupException 52 { 53 54 if (NEWONLY.toString().equalsIgnoreCase(typeName)) 55 { 56 return NEWONLY; 57 } 58 else if (ALWAYS.toString().equalsIgnoreCase(typeName)) 59 { 60 return ALWAYS; 61 } 62 else if (NEVER.toString().equalsIgnoreCase(typeName)) 63 { 64 return NEVER; 65 } 66 else 71 { 72 throw new PortalSetupException("Unsupported schema load type = '" + typeName + "' specified"); 73 } 74 } 75 } 76 | Popular Tags |