1 16 17 package org.apache.axis.constants; 18 19 import org.apache.axis.deployment.wsdd.WSDDConstants; 20 21 import javax.xml.namespace.QName ; 22 23 24 81 public class Style extends Enum { 82 83 private static final Type type = new Type(); 84 85 public static final String RPC_STR = "rpc"; 86 public static final String DOCUMENT_STR = "document"; 87 public static final String WRAPPED_STR = "wrapped"; 88 public static final String MESSAGE_STR = "message"; 89 90 91 public static final Style RPC = type.getStyle(RPC_STR); 92 public static final Style DOCUMENT = type.getStyle(DOCUMENT_STR); 93 public static final Style WRAPPED = type.getStyle(WRAPPED_STR); 94 public static final Style MESSAGE = type.getStyle(MESSAGE_STR); 95 96 public static final Style DEFAULT = RPC; 97 98 static { type.setDefault(DEFAULT); } 99 100 101 private QName provider; 102 103 public static Style getDefault() { return (Style)type.getDefault(); } 104 105 public final QName getProvider() { return provider; } 106 107 public static final Style getStyle(int style) { 108 return type.getStyle(style); 109 } 110 111 public static final Style getStyle(String style) { 112 return type.getStyle(style); 113 } 114 115 public static final Style getStyle(String style, Style dephault) { 116 return type.getStyle(style, dephault); 117 } 118 119 public static final boolean isValid(String style) { 120 return type.isValid(style); 121 } 122 123 public static final int size() { 124 return type.size(); 125 } 126 127 public static final String [] getStyles() { 128 return type.getEnumNames(); 129 } 130 131 private Object readResolve() throws java.io.ObjectStreamException { 132 return type.getStyle(value); 133 } 134 135 public static class Type extends Enum.Type { 136 private Type() { 137 super("style", new Enum [] { 138 new Style(0, RPC_STR, 139 WSDDConstants.QNAME_JAVARPC_PROVIDER), 140 new Style(1, DOCUMENT_STR, 141 WSDDConstants.QNAME_JAVARPC_PROVIDER), 142 new Style(2, WRAPPED_STR, 143 WSDDConstants.QNAME_JAVARPC_PROVIDER), 144 new Style(3, MESSAGE_STR, 145 WSDDConstants.QNAME_JAVAMSG_PROVIDER), 146 }); 147 } 148 149 public final Style getStyle(int style) { 150 return (Style)this.getEnum(style); 151 } 152 153 public final Style getStyle(String style) { 154 return (Style)this.getEnum(style); 155 } 156 157 public final Style getStyle(String style, Style dephault) { 158 return (Style)this.getEnum(style, dephault); 159 } 160 } 161 162 private Style(int value, String name, QName provider) { 163 super(type, value, name); 164 this.provider = provider; 165 } 166 167 protected Style() { 168 super(type, DEFAULT.getValue(), DEFAULT.getName()); 169 this.provider = DEFAULT.getProvider(); 170 } 171 } 172 | Popular Tags |