src/share/jaxws_classes/com/sun/xml/internal/ws/model/ParameterImpl.java

changeset 368
0989ad8c0860
parent 286
f50545b5e2f1
child 637
9c07ef4934dd
equal deleted inserted replaced
366:8c0b6bccfe47 368:0989ad8c0860
1 /* 1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this 7 * published by the Free Software Foundation. Oracle designates this
28 import com.sun.xml.internal.bind.api.Bridge; 28 import com.sun.xml.internal.bind.api.Bridge;
29 import com.sun.xml.internal.bind.api.TypeReference; 29 import com.sun.xml.internal.bind.api.TypeReference;
30 import com.sun.xml.internal.ws.api.model.JavaMethod; 30 import com.sun.xml.internal.ws.api.model.JavaMethod;
31 import com.sun.xml.internal.ws.api.model.Parameter; 31 import com.sun.xml.internal.ws.api.model.Parameter;
32 import com.sun.xml.internal.ws.api.model.ParameterBinding; 32 import com.sun.xml.internal.ws.api.model.ParameterBinding;
33 import com.sun.xml.internal.ws.spi.db.RepeatedElementBridge;
34 import com.sun.xml.internal.ws.spi.db.WrapperComposite;
33 import com.sun.xml.internal.ws.spi.db.XMLBridge; 35 import com.sun.xml.internal.ws.spi.db.XMLBridge;
34 import com.sun.xml.internal.ws.spi.db.TypeInfo; 36 import com.sun.xml.internal.ws.spi.db.TypeInfo;
35 37
36 import javax.jws.WebParam.Mode; 38 import javax.jws.WebParam.Mode;
37 import javax.xml.namespace.QName; 39 import javax.xml.namespace.QName;
63 private TypeReference typeReference; 65 private TypeReference typeReference;
64 private TypeInfo typeInfo; 66 private TypeInfo typeInfo;
65 private QName name; 67 private QName name;
66 private final JavaMethodImpl parent; 68 private final JavaMethodImpl parent;
67 69
70 WrapperParameter wrapper;
71 TypeInfo itemTypeInfo;
72
68 public ParameterImpl(JavaMethodImpl parent, TypeInfo type, Mode mode, int index) { 73 public ParameterImpl(JavaMethodImpl parent, TypeInfo type, Mode mode, int index) {
69 assert type != null; 74 assert type != null;
70 75
71 this.typeInfo = type; 76 this.typeInfo = type;
72 this.name = type.tagName; 77 this.name = type.tagName;
92 97
93 public XMLBridge getXMLBridge() { 98 public XMLBridge getXMLBridge() {
94 return getOwner().getXMLBridge(typeInfo); 99 return getOwner().getXMLBridge(typeInfo);
95 } 100 }
96 101
102 public XMLBridge getInlinedRepeatedElementBridge() {
103 TypeInfo itemType = getItemType();
104 if (itemType != null) {
105 XMLBridge xb = getOwner().getXMLBridge(itemType);
106 if (xb != null) return new RepeatedElementBridge(typeInfo, xb);
107 }
108 return null;
109 }
110
111 public TypeInfo getItemType() {
112 if (itemTypeInfo != null) return itemTypeInfo;
113 //RpcLit cannot inline repeated element in wrapper
114 if (parent.getBinding().isRpcLit() || wrapper == null) return null;
115 //InlinedRepeatedElementBridge is only used for dynamic wrapper (no wrapper class)
116 if (!WrapperComposite.class.equals(wrapper.getTypeInfo().type)) return null;
117 if (!getBinding().isBody()) return null;
118 itemTypeInfo = typeInfo.getItemType();
119 return itemTypeInfo;
120 }
121
97 /** @deprecated */ 122 /** @deprecated */
98 public Bridge getBridge() { 123 public Bridge getBridge() {
99 return getOwner().getBridge(typeReference); 124 return getOwner().getBridge(typeReference);
100 } 125 }
101 /** @deprecated */ 126 /** @deprecated */
116 return typeInfo; 141 return typeInfo;
117 } 142 }
118 143
119 /** 144 /**
120 * Sometimes we need to overwrite the typeReferenc, such as during patching for rpclit 145 * Sometimes we need to overwrite the typeReferenc, such as during patching for rpclit
121 * @see AbstractSEIModelImpl#applyParameterBinding(com.sun.xml.internal.ws.model.wsdl.WSDLBoundPortTypeImpl) 146 * @see AbstractSEIModelImpl#applyRpcLitParamBinding(JavaMethodImpl, WrapperParameter, WSDLBoundPortType, WebParam.Mode)
122 * @deprecated 147 * @deprecated
123 */ 148 */
124 void setTypeReference(TypeReference type){ 149 void setTypeReference(TypeReference type){
125 typeReference = type; 150 typeReference = type;
126 name = type.tagName; 151 name = type.tagName;
227 public void setPartName(String partName) { 252 public void setPartName(String partName) {
228 this.partName = partName; 253 this.partName = partName;
229 } 254 }
230 255
231 void fillTypes(List<TypeInfo> types) { 256 void fillTypes(List<TypeInfo> types) {
232 types.add(getTypeInfo()); 257 TypeInfo itemType = getItemType();
258 types.add((itemType != null) ? itemType : getTypeInfo());
233 } 259 }
234 } 260 }

mercurial