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 PortInfo extends com.sun.enterprise.tools.common.dd.SunBaseBean 40 { 41 42 static Vector comparators = new Vector(); 43 44 static public final String SERVICE_ENDPOINT_INTERFACE = "ServiceEndpointInterface"; static public final String WSDL_PORT = "WsdlPort"; static public final String STUB_PROPERTY = "StubProperty"; static public final String CALL_PROPERTY = "CallProperty"; 49 public PortInfo() { 50 this(Common.USE_DEFAULT_VALUES); 51 } 52 53 public PortInfo(int options) 54 { 55 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 56 this.createProperty("service-endpoint-interface", SERVICE_ENDPOINT_INTERFACE, 59 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 60 String .class); 61 this.createProperty("wsdl-port", WSDL_PORT, 63 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 64 WsdlPort.class); 65 this.createProperty("stub-property", STUB_PROPERTY, 67 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 68 StubProperty.class); 69 this.createProperty("call-property", CALL_PROPERTY, 71 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 72 CallProperty.class); 73 this.initialize(options); 74 } 75 76 void initialize(int options) 78 { 79 80 } 81 82 public void setServiceEndpointInterface(String value) { 84 this.setValue(SERVICE_ENDPOINT_INTERFACE, value); 85 } 86 87 public String getServiceEndpointInterface() { 89 return (String )this.getValue(SERVICE_ENDPOINT_INTERFACE); 90 } 91 92 public void setWsdlPort(WsdlPort value) { 94 this.setValue(WSDL_PORT, value); 95 } 96 97 public WsdlPort getWsdlPort() { 99 return (WsdlPort)this.getValue(WSDL_PORT); 100 } 101 102 public void setStubProperty(int index, StubProperty value) { 104 this.setValue(STUB_PROPERTY, index, value); 105 } 106 107 public StubProperty getStubProperty(int index) { 109 return (StubProperty)this.getValue(STUB_PROPERTY, index); 110 } 111 112 public void setStubProperty(StubProperty[] value) { 114 this.setValue(STUB_PROPERTY, value); 115 } 116 117 public StubProperty[] getStubProperty() { 119 return (StubProperty[])this.getValues(STUB_PROPERTY); 120 } 121 122 public int sizeStubProperty() { 124 return this.size(STUB_PROPERTY); 125 } 126 127 public int addStubProperty(com.sun.enterprise.tools.common.dd.StubProperty value) { 129 return this.addValue(STUB_PROPERTY, value); 130 } 131 132 public int removeStubProperty(com.sun.enterprise.tools.common.dd.StubProperty value) { 137 return this.removeValue(STUB_PROPERTY, 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 static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 180 comparators.add(c); 181 } 182 183 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 185 comparators.remove(c); 186 } 187 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 188 boolean restrictionFailure = false; 189 if (getServiceEndpointInterface() != null) { 191 } 192 if (getWsdlPort() != null) { 194 getWsdlPort().validate(); 195 } 196 for (int _index = 0; _index < sizeStubProperty(); ++_index) { 198 com.sun.enterprise.tools.common.dd.StubProperty element = getStubProperty(_index); 199 if (element != null) { 200 element.validate(); 201 } 202 } 203 for (int _index = 0; _index < sizeCallProperty(); ++_index) { 205 com.sun.enterprise.tools.common.dd.CallProperty element = getCallProperty(_index); 206 if (element != null) { 207 element.validate(); 208 } 209 } 210 } 211 212 public void dump(StringBuffer str, String indent){ 214 String s; 215 Object o; 216 org.netbeans.modules.schema2beans.BaseBean n; 217 str.append(indent); 218 str.append("ServiceEndpointInterface"); str.append(indent+"\t"); str.append("<"); s = this.getServiceEndpointInterface(); 222 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(SERVICE_ENDPOINT_INTERFACE, 0, str, indent); 225 226 str.append(indent); 227 str.append("WsdlPort"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getWsdlPort(); 229 if (n != null) 230 n.dump(str, indent + "\t"); else 232 str.append(indent+"\tnull"); this.dumpAttributes(WSDL_PORT, 0, str, indent); 234 235 str.append(indent); 236 str.append("StubProperty["+this.sizeStubProperty()+"]"); for(int i=0; i<this.sizeStubProperty(); i++) 238 { 239 str.append(indent+"\t"); 240 str.append("#"+i+":"); 241 n = (org.netbeans.modules.schema2beans.BaseBean) this.getStubProperty(i); 242 if (n != null) 243 n.dump(str, indent + "\t"); else 245 str.append(indent+"\tnull"); this.dumpAttributes(STUB_PROPERTY, i, str, indent); 247 } 248 249 str.append(indent); 250 str.append("CallProperty["+this.sizeCallProperty()+"]"); for(int i=0; i<this.sizeCallProperty(); i++) 252 { 253 str.append(indent+"\t"); 254 str.append("#"+i+":"); 255 n = (org.netbeans.modules.schema2beans.BaseBean) this.getCallProperty(i); 256 if (n != null) 257 n.dump(str, indent + "\t"); else 259 str.append(indent+"\tnull"); this.dumpAttributes(CALL_PROPERTY, i, str, indent); 261 } 262 263 } 264 public String dumpBeanNode(){ 265 StringBuffer str = new StringBuffer (); 266 str.append("PortInfo\n"); this.dump(str, "\n "); return str.toString(); 269 }} 270 271 273 274 547 | Popular Tags |