1 package net.agentis.jmi.apml; 2 3 public final class VisibilityEnum implements Visibility { 4 public static final VisibilityEnum PRIVATE = new VisibilityEnum("private"); 5 public static final VisibilityEnum PUBLIC = new VisibilityEnum("public"); 6 7 private static final java.util.List typeName; 8 private final java.lang.String literalName; 9 10 static { 11 java.util.ArrayList temp = new java.util.ArrayList (); 12 temp.add("APML"); 13 temp.add("Visibility"); 14 typeName = java.util.Collections.unmodifiableList(temp); 15 } 16 17 private VisibilityEnum(java.lang.String literalName) { 18 this.literalName = literalName; 19 } 20 21 public java.util.List refTypeName() { 22 return typeName; 23 } 24 25 public java.lang.String toString() { 26 return literalName; 27 } 28 29 public int hashCode() { 30 return literalName.hashCode(); 31 } 32 33 public boolean equals(java.lang.Object o) { 34 if (o instanceof VisibilityEnum) return (o == this); 35 else if (o instanceof Visibility) return (o.toString().equals(literalName)); 36 else return ((o instanceof javax.jmi.reflect.RefEnum) && ((javax.jmi.reflect.RefEnum) o).refTypeName().equals(typeName) && o.toString().equals(literalName)); 37 } 38 39 public static Visibility forName(java.lang.String name) { 40 if (name.equals("private")) return PRIVATE; 41 if (name.equals("public")) return PUBLIC; 42 throw new java.lang.IllegalArgumentException ("Unknown literal name '" + name + "' for enumeration 'APML.Visibility'"); 43 } 44 protected java.lang.Object readResolve() throws java.io.ObjectStreamException { 45 try { 46 return forName(literalName); 47 } catch (java.lang.IllegalArgumentException e) { 48 throw new java.io.InvalidObjectException (e.getMessage()); 49 } 50 } 51 } 52 | Popular Tags |