1 package org.apache.beehive.wsm.model.jsr181; 2 3 import javax.jws.soap.SOAPBinding; 4 5 import org.apache.beehive.wsm.model.BeehiveWsSOAPBindingInfo; 6 7 24 25 public class SOAPBindingInfo implements java.io.Serializable , BeehiveWsSOAPBindingInfo { 26 27 private static final long serialVersionUID = 1L; 28 29 SOAPBinding.Style style = SOAPBinding.Style.DOCUMENT; 30 SOAPBinding.Use use = SOAPBinding.Use.LITERAL; 31 SOAPBinding.ParameterStyle parameterStyle = SOAPBinding 32 .ParameterStyle.WRAPPED; 33 34 37 public SOAPBindingInfo() { 38 super(); 39 } 40 41 public SOAPBindingInfo(SOAPBinding annotation) { 42 initFromAnnotation(annotation); 43 } 44 45 48 public SOAPBinding.ParameterStyle getParameterStyle() { 49 return parameterStyle; 50 } 51 52 55 public void setParameterStyle(SOAPBinding.ParameterStyle parameterStyle) { 56 this.parameterStyle = parameterStyle; 57 } 58 59 62 public SOAPBinding.Style getStyle() { 63 return style; 64 } 65 66 69 public void setStyle(SOAPBinding.Style style) { 70 this.style = style; 71 } 72 73 76 public SOAPBinding.Use getUse() { 77 return use; 78 } 79 80 83 public void setUse(SOAPBinding.Use use) { 84 this.use = use; 85 } 86 87 90 private void initFromAnnotation(SOAPBinding annotation) { 91 setStyle(annotation.style()); 92 setUse(annotation.use()); 93 setParameterStyle(annotation.parameterStyle()); 94 95 } 97 98 public int hashCode() { 99 return (((getStyle().hashCode() * 31) + getUse().hashCode()) * 31) 100 + getParameterStyle().hashCode(); 101 } 102 103 public String toString() { 104 StringBuffer sb = new StringBuffer ("SOAPBindingInfo: "); 105 boolean rpc = (getStyle() == SOAPBinding.Style.RPC); 106 boolean encoded = (getUse() == SOAPBinding.Use.ENCODED); 107 sb.append(rpc ? "RPC" : "DOCUMENT"); 108 sb.append('/'); 109 sb.append(encoded ? "ENCODED" : "LITERAL"); 110 if (!rpc && !encoded) { 111 sb.append('-'); 112 sb.append((getParameterStyle() == SOAPBinding 113 .ParameterStyle.BARE) 114 ? "BARE" : "WRAPPED"); 115 } 116 return sb.toString(); 117 } 118 119 public boolean equals(Object o) { 120 if (o != null) { 121 if (o instanceof SOAPBindingInfo) { 122 SOAPBindingInfo sbi = (SOAPBindingInfo)o; 123 return (getStyle().equals(sbi.getStyle()) 124 && getUse().equals(sbi.getUse()) 125 && getParameterStyle().equals(sbi.getParameterStyle())); 126 } 127 } 128 return false; 129 } 130 } 131 | Popular Tags |