1 23 24 package org.enhydra.xml.xmlc.metadata; 25 26 29 public class ParserType extends EnumeratedType { 30 33 public static final ParserType XERCES = new ParserType("xerces"); 34 35 38 public static final ParserType TIDY = new ParserType("tidy"); 39 40 43 public static final ParserType SWING = new ParserType("swing"); 44 45 48 private ParserType(String name) { 49 super(name); 50 } 51 52 56 public static ParserType getType(String desiredType) { 57 if (desiredType == null) { 58 return null; 59 } else if (XERCES.fName.equals(desiredType)) { 60 return XERCES; 61 } else if (TIDY.fName.equals(desiredType)) { 62 return TIDY; 63 } else if (SWING.fName.equals(desiredType)) { 64 return SWING; 65 } else { 66 throw new IllegalArgumentException ("Invalid ParserType: \"" 67 + desiredType 68 + "\", expected of \"" 69 + XERCES.fName + "\", \"" 70 + TIDY.fName + "\", or \"" 71 + SWING.fName + "\""); 72 } 73 } 74 } 75 | Popular Tags |