1 55 package org.jboss.axis.wsdl; 56 57 import javax.xml.namespace.QName ; 58 import javax.xml.rpc.ParameterMode ; 59 import java.util.HashMap ; 60 61 64 public class SkeletonImpl implements Skeleton 65 { 66 private static HashMap table = null; 67 68 71 public SkeletonImpl() 72 { 73 if (table == null) 74 { 75 table = new HashMap (); 76 } 77 } 78 79 class MetaInfo 80 { 81 QName [] names; 82 ParameterMode [] modes; 83 String inputNamespace; 84 String outputNamespace; 85 String soapAction; 86 87 MetaInfo(QName [] names, ParameterMode [] modes, String inputNamespace, 88 String outputNamespace, String soapAction) 89 { 90 this.names = names; 91 this.modes = modes; 92 this.inputNamespace = inputNamespace; 93 this.outputNamespace = outputNamespace; 94 this.soapAction = soapAction; 95 } 96 } 97 98 103 public void add(String operation, QName [] names, ParameterMode [] modes, 104 String inputNamespace, String outputNamespace, String soapAction) 105 { 106 table.put(operation, new MetaInfo(names, modes, inputNamespace, 107 outputNamespace, soapAction)); 108 } 109 110 114 public void add(String operation, String [] names, ParameterMode [] modes, 115 String inputNamespace, String outputNamespace, String soapAction) 116 { 117 QName [] qnames = new QName [names.length]; 118 for (int i = 0; i < names.length; i++) 119 { 120 QName qname = new QName (null, names[i]); 121 qnames[i] = qname; 122 } 123 add(operation, qnames, modes, inputNamespace, 124 outputNamespace, soapAction); 125 } 126 127 132 public QName getParameterName(String operationName, int n) 133 { 134 MetaInfo value = (MetaInfo)table.get(operationName); 135 if (value == null || 136 value.names == null || 137 value.names.length <= n + 1) 138 { 139 return null; 140 } 141 return value.names[n + 1]; 142 } 143 144 149 public ParameterMode getParameterMode(String operationName, int n) 150 { 151 MetaInfo value = (MetaInfo)table.get(operationName); 152 if (value == null || 153 value.modes == null || 154 value.modes.length <= n + 1) 155 { 156 return null; 157 } 158 return value.modes[n + 1]; 159 } 160 161 165 public String getInputNamespace(String operationName) 166 { 167 MetaInfo value = (MetaInfo)table.get(operationName); 168 if (value == null) 169 { 170 return null; 171 } 172 return value.inputNamespace; 173 } 174 175 179 public String getOutputNamespace(String operationName) 180 { 181 MetaInfo value = (MetaInfo)table.get(operationName); 182 if (value == null) 183 { 184 return null; 185 } 186 return value.outputNamespace; 187 } 188 189 193 public String getSOAPAction(String operationName) 194 { 195 MetaInfo value = (MetaInfo)table.get(operationName); 196 if (value == null) 197 { 198 return null; 199 } 200 return value.soapAction; 201 } 202 203 } 204 | Popular Tags |