1 19 20 package org.netbeans.jmi.javamodel; 21 22 29 public final class ErrorTypeEnum implements ErrorType { 30 33 public static final ErrorTypeEnum ERROR = new ErrorTypeEnum("error"); 34 37 public static final ErrorTypeEnum WARNING = new ErrorTypeEnum("warning"); 38 39 private static final java.util.List typeName; 40 private final java.lang.String literalName; 41 42 static { 43 java.util.ArrayList temp = new java.util.ArrayList (); 44 temp.add("JavaModel"); 45 temp.add("ErrorType"); 46 typeName = java.util.Collections.unmodifiableList(temp); 47 } 48 49 private ErrorTypeEnum(java.lang.String literalName) { 50 this.literalName = literalName; 51 } 52 53 57 public java.util.List refTypeName() { 58 return typeName; 59 } 60 61 65 public java.lang.String toString() { 66 return literalName; 67 } 68 69 73 public int hashCode() { 74 return literalName.hashCode(); 75 } 76 77 83 public boolean equals(java.lang.Object o) { 84 if (o instanceof ErrorTypeEnum) return (o == this); 85 else if (o instanceof ErrorType) return (o.toString().equals(literalName)); 86 else return ((o instanceof javax.jmi.reflect.RefEnum) && ((javax.jmi.reflect.RefEnum) o).refTypeName().equals(typeName) && o.toString().equals(literalName)); 87 } 88 89 94 public static ErrorType forName(java.lang.String name) { 95 if (name.equals("error")) return ERROR; 96 if (name.equals("warning")) return WARNING; 97 throw new java.lang.IllegalArgumentException ("Unknown literal name '" + name + "' for enumeration 'JavaModel.ErrorType'"); 98 } 99 103 protected java.lang.Object readResolve() throws java.io.ObjectStreamException { 104 try { 105 return forName(literalName); 106 } catch (java.lang.IllegalArgumentException e) { 107 throw new java.io.InvalidObjectException (e.getMessage()); 108 } 109 } 110 } 111 | Popular Tags |