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

changeset 368
0989ad8c0860
parent 286
f50545b5e2f1
child 637
9c07ef4934dd
     1.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/model/ParameterImpl.java	Thu Apr 04 19:05:24 2013 -0700
     1.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/model/ParameterImpl.java	Tue Apr 09 14:51:13 2013 +0100
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -30,6 +30,8 @@
    1.11  import com.sun.xml.internal.ws.api.model.JavaMethod;
    1.12  import com.sun.xml.internal.ws.api.model.Parameter;
    1.13  import com.sun.xml.internal.ws.api.model.ParameterBinding;
    1.14 +import com.sun.xml.internal.ws.spi.db.RepeatedElementBridge;
    1.15 +import com.sun.xml.internal.ws.spi.db.WrapperComposite;
    1.16  import com.sun.xml.internal.ws.spi.db.XMLBridge;
    1.17  import com.sun.xml.internal.ws.spi.db.TypeInfo;
    1.18  
    1.19 @@ -65,6 +67,9 @@
    1.20      private QName name;
    1.21      private final JavaMethodImpl parent;
    1.22  
    1.23 +    WrapperParameter wrapper;
    1.24 +    TypeInfo itemTypeInfo;
    1.25 +
    1.26      public ParameterImpl(JavaMethodImpl parent, TypeInfo type, Mode mode, int index) {
    1.27          assert type != null;
    1.28  
    1.29 @@ -94,6 +99,26 @@
    1.30          return getOwner().getXMLBridge(typeInfo);
    1.31      }
    1.32  
    1.33 +    public XMLBridge getInlinedRepeatedElementBridge() {
    1.34 +        TypeInfo itemType = getItemType();
    1.35 +        if (itemType != null) {
    1.36 +            XMLBridge xb = getOwner().getXMLBridge(itemType);
    1.37 +            if (xb != null) return new RepeatedElementBridge(typeInfo, xb);
    1.38 +        }
    1.39 +        return null;
    1.40 +    }
    1.41 +
    1.42 +    public TypeInfo getItemType() {
    1.43 +        if (itemTypeInfo != null) return itemTypeInfo;
    1.44 +        //RpcLit cannot inline repeated element in wrapper
    1.45 +        if (parent.getBinding().isRpcLit() || wrapper == null) return null;
    1.46 +        //InlinedRepeatedElementBridge is only used for dynamic wrapper (no wrapper class)
    1.47 +        if (!WrapperComposite.class.equals(wrapper.getTypeInfo().type)) return null;
    1.48 +        if (!getBinding().isBody()) return null;
    1.49 +        itemTypeInfo = typeInfo.getItemType();
    1.50 +        return  itemTypeInfo;
    1.51 +    }
    1.52 +
    1.53      /**  @deprecated  */
    1.54      public Bridge getBridge() {
    1.55          return getOwner().getBridge(typeReference);
    1.56 @@ -118,7 +143,7 @@
    1.57  
    1.58      /**
    1.59       * Sometimes we need to overwrite the typeReferenc, such as during patching for rpclit
    1.60 -     * @see AbstractSEIModelImpl#applyParameterBinding(com.sun.xml.internal.ws.model.wsdl.WSDLBoundPortTypeImpl)
    1.61 +     * @see AbstractSEIModelImpl#applyRpcLitParamBinding(JavaMethodImpl, WrapperParameter, WSDLBoundPortType, WebParam.Mode)
    1.62       * @deprecated
    1.63       */
    1.64      void setTypeReference(TypeReference type){
    1.65 @@ -229,6 +254,7 @@
    1.66      }
    1.67  
    1.68      void fillTypes(List<TypeInfo> types) {
    1.69 -        types.add(getTypeInfo());
    1.70 +        TypeInfo itemType = getItemType();
    1.71 +        types.add((itemType != null) ? itemType : getTypeInfo());
    1.72      }
    1.73  }

mercurial