1 19 20 21 package org.netbeans.modules.xml.wsdl.model.extensions.soap.impl; 22 23 import org.netbeans.modules.xml.wsdl.model.Binding; 24 import org.netbeans.modules.xml.wsdl.model.WSDLModel; 25 import org.netbeans.modules.xml.wsdl.model.extensions.soap.SOAPBinding; 26 import org.netbeans.modules.xml.wsdl.model.extensions.soap.SOAPBinding.Style; 27 import org.netbeans.modules.xml.wsdl.model.extensions.soap.SOAPComponent; 28 import org.netbeans.modules.xml.wsdl.model.extensions.soap.SOAPQName; 29 import org.netbeans.modules.xml.xam.Component; 30 import org.w3c.dom.Element ; 31 32 36 public class SOAPBindingImpl extends SOAPComponentImpl implements SOAPBinding{ 37 38 39 public SOAPBindingImpl(WSDLModel model, Element e) { 40 super(model, e); 41 } 42 43 public SOAPBindingImpl(WSDLModel model){ 44 this(model, createPrefixedElement(SOAPQName.BINDING.getQName(), model)); 45 } 46 47 public void accept(SOAPComponent.Visitor visitor) { 48 visitor.visit(this); 49 } 50 51 public void setTransportURI(String transportURI) { 52 setAttribute(TRANSPORT_URI_PROPERTY, SOAPAttribute.TRANSPORT_URI, transportURI); 53 } 54 55 public String getTransportURI() { 56 return getAttribute(SOAPAttribute.TRANSPORT_URI); 57 } 58 59 public void setStyle(Style style) { 60 setAttribute(STYLE_PROPERTY, SOAPAttribute.STYLE, style); 61 } 62 63 public Style getStyle() { 64 String s = getAttribute(SOAPAttribute.STYLE); 65 return s == null ? null : Style.valueOf(s.toUpperCase()); 66 } 67 68 private Style getStyleValueOf(String s) { 69 return s == null ? null : Style.valueOf(s.toUpperCase()); 70 } 71 72 protected Object getAttributeValueOf(SOAPAttribute attr, String s) { 73 if (attr == SOAPAttribute.STYLE) { 74 return getStyleValueOf(s); 75 } else { 76 return super.getAttributeValueOf(attr, s); 77 } 78 } 79 80 81 @Override 82 public boolean canBeAddedTo(Component target) { 83 if (target instanceof Binding) { 84 return true; 85 } 86 return false; 87 } 88 } 89 | Popular Tags |