1 16 package org.apache.axis.wsdl; 17 18 import javax.xml.namespace.QName ; 19 import javax.xml.rpc.ParameterMode ; 20 import java.util.HashMap ; 21 22 25 public class SkeletonImpl implements Skeleton { 26 27 28 private static HashMap table = null; 29 30 33 public SkeletonImpl() { 34 35 if (table == null) { 36 table = new HashMap (); 37 } 38 } 39 40 45 class MetaInfo { 46 47 48 QName [] names; 49 50 51 ParameterMode [] modes; 52 53 54 String inputNamespace; 55 56 57 String outputNamespace; 58 59 60 String soapAction; 61 62 71 MetaInfo(QName [] names, ParameterMode [] modes, String inputNamespace, 72 String outputNamespace, String soapAction) { 73 74 this.names = names; 75 this.modes = modes; 76 this.inputNamespace = inputNamespace; 77 this.outputNamespace = outputNamespace; 78 this.soapAction = soapAction; 79 } 80 } 81 82 94 public void add(String operation, QName [] names, ParameterMode [] modes, 95 String inputNamespace, String outputNamespace, 96 String soapAction) { 97 98 table.put(operation, 99 new MetaInfo(names, modes, inputNamespace, outputNamespace, 100 soapAction)); 101 } 102 103 114 public void add(String operation, String [] names, ParameterMode [] modes, 115 String inputNamespace, String outputNamespace, 116 String soapAction) { 117 118 QName [] qnames = new QName [names.length]; 119 120 for (int i = 0; i < names.length; i++) { 121 QName qname = new QName (null, names[i]); 122 123 qnames[i] = qname; 124 } 125 126 add(operation, qnames, modes, inputNamespace, outputNamespace, 127 soapAction); 128 } 129 130 139 public QName getParameterName(String operationName, int n) { 140 141 MetaInfo value = (MetaInfo) table.get(operationName); 142 143 if ((value == null) || (value.names == null) 144 || (value.names.length <= n + 1)) { 145 return null; 146 } 147 148 return value.names[n + 1]; 149 } 150 151 160 public ParameterMode getParameterMode(String operationName, int n) { 161 162 MetaInfo value = (MetaInfo) table.get(operationName); 163 164 if ((value == null) || (value.modes == null) 165 || (value.modes.length <= n + 1)) { 166 return null; 167 } 168 169 return value.modes[n + 1]; 170 } 171 172 179 public String getInputNamespace(String operationName) { 180 181 MetaInfo value = (MetaInfo) table.get(operationName); 182 183 if (value == null) { 184 return null; 185 } 186 187 return value.inputNamespace; 188 } 189 190 197 public String getOutputNamespace(String operationName) { 198 199 MetaInfo value = (MetaInfo) table.get(operationName); 200 201 if (value == null) { 202 return null; 203 } 204 205 return value.outputNamespace; 206 } 207 208 215 public String getSOAPAction(String operationName) { 216 217 MetaInfo value = (MetaInfo) table.get(operationName); 218 219 if (value == null) { 220 return null; 221 } 222 223 return value.soapAction; 224 } 225 } 226 | Popular Tags |