1 55 56 package org.jboss.axis.enums; 57 58 import org.jboss.axis.Constants; 59 60 61 66 public class Use extends Enum 67 { 68 69 73 74 private static final Type type = new Type(); 75 76 public static final String ENCODED_STR = "encoded"; 77 public static final String LITERAL_STR = "literal"; 78 79 public static final Use ENCODED = type.getUse(ENCODED_STR); 80 public static final Use LITERAL = type.getUse(LITERAL_STR); 81 82 public static final Use DEFAULT = ENCODED; 83 84 static 85 { 86 type.setDefault(DEFAULT); 87 } 88 89 private String encoding; 90 91 public static Use getDefault() 92 { 93 return (Use)type.getDefault(); 94 } 95 96 public final String getEncoding() 97 { 98 return encoding; 99 } 100 101 public static final Use getUse(int style) 102 { 103 return type.getUse(style); 104 } 105 106 public static final Use getUse(String style) 107 { 108 return type.getUse(style); 109 } 110 111 public static final Use getUse(String style, Use dephault) 112 { 113 return type.getUse(style, dephault); 114 } 115 116 public static final boolean isValid(String style) 117 { 118 return type.isValid(style); 119 } 120 121 public static final int size() 122 { 123 return type.size(); 124 } 125 126 public static final String [] getUses() 127 { 128 return type.getEnumNames(); 129 } 130 131 public static class Type extends Enum.Type 132 { 133 private Type() 134 { 135 super("style", new Enum []{ 136 new Use(0, ENCODED_STR, 137 Constants.URI_DEFAULT_SOAP_ENC), 138 new Use(1, LITERAL_STR, 139 Constants.URI_LITERAL_ENC), 140 }); 141 } 142 143 public final Use getUse(int style) 144 { 145 return (Use)this.getEnum(style); 146 } 147 148 public final Use getUse(String style) 149 { 150 return (Use)this.getEnum(style); 151 } 152 153 public final Use getUse(String style, Use dephault) 154 { 155 return (Use)this.getEnum(style, dephault); 156 } 157 158 } 159 160 private Use(int value, String name, String encoding) 161 { 162 super(type, value, name); 163 this.encoding = encoding; 164 } 165 } 166 167 ; 168 | Popular Tags |