1 23 24 29 30 package com.sun.enterprise.tools.common.dd; 31 32 import org.w3c.dom.*; 33 import org.netbeans.modules.schema2beans.*; 34 import java.beans.*; 35 import java.util.*; 36 37 39 public class ServiceRef extends com.sun.enterprise.tools.common.dd.SunBaseBean 40 { 41 42 static Vector comparators = new Vector(); 43 44 static public final String SERVICE_REF_NAME = "ServiceRefName"; static public final String PORT_INFO = "PortInfo"; static public final String CALL_PROPERTY = "CallProperty"; static public final String WSDL_OVERRIDE = "WsdlOverride"; static public final String SERVICE_IMPL_CLASS = "ServiceImplClass"; static public final String SERVICE_QNAME = "ServiceQname"; 51 public ServiceRef() { 52 this(Common.USE_DEFAULT_VALUES); 53 } 54 55 public ServiceRef(int options) 56 { 57 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 58 this.createProperty("service-ref-name", SERVICE_REF_NAME, 61 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 62 String .class); 63 this.createProperty("port-info", PORT_INFO, 65 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 66 PortInfo.class); 67 this.createProperty("call-property", CALL_PROPERTY, 69 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 70 CallProperty.class); 71 this.createProperty("wsdl-override", WSDL_OVERRIDE, 73 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 74 String .class); 75 this.createProperty("service-impl-class", SERVICE_IMPL_CLASS, 77 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 78 String .class); 79 this.createProperty("service-qname", SERVICE_QNAME, 81 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 82 ServiceQname.class); 83 this.initialize(options); 84 } 85 86 void initialize(int options) 88 { 89 90 } 91 92 public void setServiceRefName(String value) { 94 this.setValue(SERVICE_REF_NAME, value); 95 } 96 97 public String getServiceRefName() { 99 return (String )this.getValue(SERVICE_REF_NAME); 100 } 101 102 public void setPortInfo(int index, PortInfo value) { 104 this.setValue(PORT_INFO, index, value); 105 } 106 107 public PortInfo getPortInfo(int index) { 109 return (PortInfo)this.getValue(PORT_INFO, index); 110 } 111 112 public void setPortInfo(PortInfo[] value) { 114 this.setValue(PORT_INFO, value); 115 } 116 117 public PortInfo[] getPortInfo() { 119 return (PortInfo[])this.getValues(PORT_INFO); 120 } 121 122 public int sizePortInfo() { 124 return this.size(PORT_INFO); 125 } 126 127 public int addPortInfo(com.sun.enterprise.tools.common.dd.PortInfo value) { 129 return this.addValue(PORT_INFO, value); 130 } 131 132 public int removePortInfo(com.sun.enterprise.tools.common.dd.PortInfo value) { 137 return this.removeValue(PORT_INFO, value); 138 } 139 140 public void setCallProperty(int index, CallProperty value) { 142 this.setValue(CALL_PROPERTY, index, value); 143 } 144 145 public CallProperty getCallProperty(int index) { 147 return (CallProperty)this.getValue(CALL_PROPERTY, index); 148 } 149 150 public void setCallProperty(CallProperty[] value) { 152 this.setValue(CALL_PROPERTY, value); 153 } 154 155 public CallProperty[] getCallProperty() { 157 return (CallProperty[])this.getValues(CALL_PROPERTY); 158 } 159 160 public int sizeCallProperty() { 162 return this.size(CALL_PROPERTY); 163 } 164 165 public int addCallProperty(com.sun.enterprise.tools.common.dd.CallProperty value) { 167 return this.addValue(CALL_PROPERTY, value); 168 } 169 170 public int removeCallProperty(com.sun.enterprise.tools.common.dd.CallProperty value) { 175 return this.removeValue(CALL_PROPERTY, value); 176 } 177 178 public void setWsdlOverride(String value) { 180 this.setValue(WSDL_OVERRIDE, value); 181 } 182 183 public String getWsdlOverride() { 185 return (String )this.getValue(WSDL_OVERRIDE); 186 } 187 188 public void setServiceImplClass(String value) { 190 this.setValue(SERVICE_IMPL_CLASS, value); 191 } 192 193 public String getServiceImplClass() { 195 return (String )this.getValue(SERVICE_IMPL_CLASS); 196 } 197 198 public void setServiceQname(ServiceQname value) { 200 this.setValue(SERVICE_QNAME, value); 201 } 202 203 public ServiceQname getServiceQname() { 205 return (ServiceQname)this.getValue(SERVICE_QNAME); 206 } 207 208 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 210 comparators.add(c); 211 } 212 213 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 215 comparators.remove(c); 216 } 217 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 218 boolean restrictionFailure = false; 219 if (getServiceRefName() == null) { 221 throw new org.netbeans.modules.schema2beans.ValidateException("getServiceRefName() == null", "serviceRefName", this); } 223 for (int _index = 0; _index < sizePortInfo(); ++_index) { 225 com.sun.enterprise.tools.common.dd.PortInfo element = getPortInfo(_index); 226 if (element != null) { 227 element.validate(); 228 } 229 } 230 for (int _index = 0; _index < sizeCallProperty(); ++_index) { 232 com.sun.enterprise.tools.common.dd.CallProperty element = getCallProperty(_index); 233 if (element != null) { 234 element.validate(); 235 } 236 } 237 if (getWsdlOverride() != null) { 239 } 240 if (getServiceImplClass() != null) { 242 } 243 if (getServiceQname() != null) { 245 getServiceQname().validate(); 246 } 247 } 248 249 public void dump(StringBuffer str, String indent){ 251 String s; 252 Object o; 253 org.netbeans.modules.schema2beans.BaseBean n; 254 str.append(indent); 255 str.append("ServiceRefName"); str.append(indent+"\t"); str.append("<"); s = this.getServiceRefName(); 259 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(SERVICE_REF_NAME, 0, str, indent); 262 263 str.append(indent); 264 str.append("PortInfo["+this.sizePortInfo()+"]"); for(int i=0; i<this.sizePortInfo(); i++) 266 { 267 str.append(indent+"\t"); 268 str.append("#"+i+":"); 269 n = (org.netbeans.modules.schema2beans.BaseBean) this.getPortInfo(i); 270 if (n != null) 271 n.dump(str, indent + "\t"); else 273 str.append(indent+"\tnull"); this.dumpAttributes(PORT_INFO, i, str, indent); 275 } 276 277 str.append(indent); 278 str.append("CallProperty["+this.sizeCallProperty()+"]"); for(int i=0; i<this.sizeCallProperty(); i++) 280 { 281 str.append(indent+"\t"); 282 str.append("#"+i+":"); 283 n = (org.netbeans.modules.schema2beans.BaseBean) this.getCallProperty(i); 284 if (n != null) 285 n.dump(str, indent + "\t"); else 287 str.append(indent+"\tnull"); this.dumpAttributes(CALL_PROPERTY, i, str, indent); 289 } 290 291 str.append(indent); 292 str.append("WsdlOverride"); str.append(indent+"\t"); str.append("<"); s = this.getWsdlOverride(); 296 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(WSDL_OVERRIDE, 0, str, indent); 299 300 str.append(indent); 301 str.append("ServiceImplClass"); str.append(indent+"\t"); str.append("<"); s = this.getServiceImplClass(); 305 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(SERVICE_IMPL_CLASS, 0, str, indent); 308 309 str.append(indent); 310 str.append("ServiceQname"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getServiceQname(); 312 if (n != null) 313 n.dump(str, indent + "\t"); else 315 str.append(indent+"\tnull"); this.dumpAttributes(SERVICE_QNAME, 0, str, indent); 317 318 } 319 public String dumpBeanNode(){ 320 StringBuffer str = new StringBuffer (); 321 str.append("ServiceRef\n"); this.dump(str, "\n "); return str.toString(); 324 }} 325 326 328 329 602 | Popular Tags |