1 17 package org.apache.ws.jaxme.generator.sg; 18 19 import java.io.Serializable ; 20 21 24 public interface Facet { 25 public class Type implements Serializable { 26 private final String name; 27 Type(String pName) { name = pName; } 28 public String getName() { return name; } 29 public String toString() { return name; } 30 private static final Type[] instances = new Type[]{ 31 ENUMERATION, FRACTION_DIGITS, LENGTH, MAX_EXCLUSIVE, MAX_INCLUSIVE, 32 MAX_LENGTH, MIN_EXCLUSIVE, MIN_INCLUSIVE, MIN_LENGTH, PATTERN, TOTAL_DIGITS 33 }; 34 public static Type valueOf(String pName) { 35 for (int i = 0; i < instances.length; i++) { 36 if (instances[i].name.equals(pName)) { 37 return instances[i]; 38 } 39 } 40 throw new IllegalArgumentException ("Unknown facet type: " + pName); 41 } 42 public int hashCode() { return name.hashCode(); } 43 public boolean equals(Object o) { 44 return o != null && (o instanceof Type) && ((Type) o).name.equals(name); 45 } 46 }; 47 48 51 public static final Type ENUMERATION = new Type("enumeration"); 52 53 56 public static final Type FRACTION_DIGITS = new Type("fractionDigits"); 57 58 61 public static final Type LENGTH = new Type("length"); 62 63 66 public static final Type MAX_LENGTH = new Type("maxLength"); 67 68 71 public static final Type MAX_EXCLUSIVE = new Type("maxExclusive"); 72 73 76 public static final Type MAX_INCLUSIVE = new Type("maxInclusive"); 77 78 81 public static final Type MIN_LENGTH = new Type("minLength"); 82 83 86 public static final Type MIN_EXCLUSIVE = new Type("minExclusive"); 87 88 91 public static final Type MIN_INCLUSIVE = new Type("minInclusive"); 92 93 96 public static final Type PATTERN = new Type("pattern"); 97 98 101 public static final Type TOTAL_DIGITS = new Type("totalDigits"); 102 103 105 public Type getType(); 106 107 110 public String [] getValues(); 111 112 115 public String getValue(); 116 117 120 public long getNumValue(); 121 } 122 | Popular Tags |