Package org.jboss.ws.metadata.umdm

Examples of org.jboss.ws.metadata.umdm.WrappedParameter


            String variable = variableMap.get(elementName);
            if (variable == null)
               throw new IllegalArgumentException("Could not determine variable name for element: " + elementName);

            WrappedParameter wrapped = new WrappedParameter(new QName(elementName), partMapping.getParamType(), variable, partMapping.getParamPosition());

            String parameterMode = wsdlMessageMapping.getParameterMode();
            if (parameterMode == null || parameterMode.length() < 2)
               throw new IllegalArgumentException("Invalid parameter mode for element: " + elementName);

            if (!"OUT".equals(parameterMode))
               wrappedParameters.add(wrapped);
            if (!"IN".equals(parameterMode))
            {
               wrapped.setHolder(true);
               // wrapped parameters can not be shared between request/response objects (accessors)
               if ("INOUT".equals(parameterMode))
                  wrapped = new WrappedParameter(wrapped);
               wrappedResponseParameters.add(wrapped);
            }
         }
         inMetaData.setWrappedParameters(wrappedParameters);
         wsdlPosition = wrappedParameters.size();
View Full Code Here


               if (variable == null)
                  throw new IllegalArgumentException("Could not determine variable name for element: " + elementName);

               String wrappedType = returnValueMapping.getMethodReturnValue();
               QName element = new QName(elementName);
               WrappedParameter wrappedParameter = new WrappedParameter(element, wrappedType, variable, WrappedParameter.RETURN);
               wrappedResponseParameters.add(0, wrappedParameter);
            }
         }

         outMetaData.setWrappedParameters(wrappedResponseParameters);
View Full Code Here

         if (isWrapped)
         {
            QName wrappedElementName = getWebParamName(opMetaData, i, anWebParam);
            String variable = convertToVariable(wrappedElementName.getLocalPart());

            WrappedParameter wrappedParameter = new WrappedParameter(wrappedElementName, javaTypeName, variable, i);
            wrappedParameter.setTypeArguments(convertTypeArguments(javaType, genericType));

            if (mode != ParameterMode.OUT)
               wrappedParameters.add(wrappedParameter);

            if (mode != ParameterMode.IN)
            {
               wrappedParameter.setHolder(true);

               // WrappedParameters can not be shared between request/response objects (accessors)
               if (mode == ParameterMode.INOUT)
                  wrappedParameter = new WrappedParameter(wrappedParameter);
               wrappedOutputParameters.add(wrappedParameter);
            }

            processAttachmentAnnotationsWrapped(scanResult, i, wrappedParameter);
         }
         else
         {
            QName xmlName = getWebParamName(opMetaData, i, anWebParam);

            ParameterMetaData paramMetaData = new ParameterMetaData(opMetaData, xmlName, javaTypeName);
            paramMetaData.setInHeader(isHeader);
            paramMetaData.setIndex(i);
            paramMetaData.setMode(mode);

            /*
             * Note: The TCK enforces the following rule in the spec regarding
             * partName: "This is only used if the operation is rpc style or if
             * the operation is document style and the parameter style is BARE."
             *
             * This seems to be a flaw in the spec, because the intention is
             * obviously to prevent the ambiguity of wrapped parameters that
             * specify different partName values. There is, however, no reason
             * that this limitation should apply to header parameters since they
             * are never wrapped. In order to comply we adhere to this confusing
             * rule, although I will ask for clarification.
             */
            if (anWebParam != null && !opMetaData.isDocumentWrapped() && anWebParam.partName().length() > 0)
               paramMetaData.setPartName(anWebParam.partName());

            opMetaData.addParameter(paramMetaData);
            javaTypes.add(javaType);
            typeRefs.add(new TypeReference(xmlName, genericType, parameterAnnotations[i]));

            processAttachmentAnnotations(scanResult, i, paramMetaData);
            processMIMEBinding(epMetaData, opMetaData, paramMetaData);
         }
      }

      // Build result meta data
      Class returnType = method.getReturnType();
      Type genericReturnType = method.getGenericReturnType();
      String returnTypeName = returnType.getName();
      if (!(returnType == void.class))
      {
         if (opMetaData.isOneWay())
            throw new IllegalArgumentException("[JSR-181 2.5.1] The method '" + method.getName() + "' can not have a return value if it is marked OneWay");

         WebResult anWebResult = method.getAnnotation(WebResult.class);
         boolean isHeader = anWebResult != null && anWebResult.header();
         boolean isWrappedBody = opMetaData.isDocumentWrapped() && !isHeader;
         QName xmlName = getWebResultName(opMetaData, anWebResult);

         if (isWrappedBody)
         {
            WrappedParameter wrapped = new WrappedParameter(xmlName, returnTypeName, convertToVariable(xmlName.getLocalPart()), -1);
            wrapped.setTypeArguments(convertTypeArguments(returnType, genericReturnType));

            // insert at the beginning just for prettiness
            wrappedOutputParameters.add(0, wrapped);

            processAttachmentAnnotationsWrapped(scanResult, -1, wrapped);
View Full Code Here

         if (returnParam != null && ((! isWrapped) || (! returnParam.getWrappedParameters().isEmpty())))
         {
            String name, type;
            if (isWrapped)
            {
               WrappedParameter wrappedParameter = returnParam.getWrappedParameters().get(0);
               name = wrappedParameter.getName().getLocalPart();
               type = wrappedParameter.getType();
            }
            else
            {
               name = returnParam.getXmlName().getLocalPart();
               type = returnParam.getJavaTypeName();
View Full Code Here

         if (isWrapped)
         {
            QName wrappedElementName = getWebParamName(opMetaData, i, anWebParam);
            String variable = convertToVariable(wrappedElementName.getLocalPart());

            WrappedParameter wrappedParameter = new WrappedParameter(wrappedElementName, javaTypeName, variable, i);
            wrappedParameter.setTypeArguments(convertTypeArguments(javaType, genericType));

            if (mode != ParameterMode.OUT)
               wrappedParameters.add(wrappedParameter);

            if (mode != ParameterMode.IN)
            {
               wrappedParameter.setHolder(true);

               // WrappedParameters can not be shared between request/response objects (accessors)
               if (mode == ParameterMode.INOUT)
                  wrappedParameter = new WrappedParameter(wrappedParameter);
               wrappedOutputParameters.add(wrappedParameter);
            }

            processAttachmentAnnotationsWrapped(scanResult, i, wrappedParameter);
         }
         else
         {
            QName xmlName = getWebParamName(opMetaData, i, anWebParam);

            ParameterMetaData paramMetaData = new ParameterMetaData(opMetaData, xmlName, javaTypeName);
            paramMetaData.setInHeader(isHeader);
            paramMetaData.setIndex(i);
            paramMetaData.setMode(mode);

            /*
             * Note: The TCK enforces the following rule in the spec regarding
             * partName: "This is only used if the operation is rpc style or if
             * the operation is document style and the parameter style is BARE."
             *
             * This seems to be a flaw in the spec, because the intention is
             * obviously to prevent the ambiguity of wrapped parameters that
             * specify different partName values. There is, however, no reason
             * that this limitation should apply to header parameters since they
             * are never wrapped. In order to comply we adhere to this confusing
             * rule, although I will ask for clarification.
             */
            if (anWebParam != null && !opMetaData.isDocumentWrapped() && anWebParam.partName().length() > 0)
               paramMetaData.setPartName(anWebParam.partName());

            opMetaData.addParameter(paramMetaData);
            javaTypes.add(javaType);
            typeRefs.add(new TypeReference(xmlName, genericType, parameterAnnotations[i]));

            processAttachmentAnnotations(scanResult, i, paramMetaData);
            processMIMEBinding(epMetaData, opMetaData, paramMetaData);
         }
      }

      // Build result meta data
      Class returnType = method.getReturnType();
      Type genericReturnType = method.getGenericReturnType();
      String returnTypeName = returnType.getName();
      if (!(returnType == void.class))
      {
         if (opMetaData.isOneWay())
            throw new IllegalArgumentException("[JSR-181 2.5.1] The method '" + method.getName() + "' can not have a return value if it is marked OneWay");

         WebResult anWebResult = method.getAnnotation(WebResult.class);
         boolean isHeader = anWebResult != null && anWebResult.header();
         boolean isWrappedBody = opMetaData.isDocumentWrapped() && !isHeader;
         QName xmlName = getWebResultName(opMetaData, anWebResult);

         if (isWrappedBody)
         {
            WrappedParameter wrapped = new WrappedParameter(xmlName, returnTypeName, convertToVariable(xmlName.getLocalPart()), -1);
            wrapped.setTypeArguments(convertTypeArguments(returnType, genericReturnType));

            // insert at the beginning just for prettiness
            wrappedOutputParameters.add(0, wrapped);

            processAttachmentAnnotationsWrapped(scanResult, -1, wrapped);
View Full Code Here

         if (returnParam != null && ((! isWrapped) || (! returnParam.getWrappedParameters().isEmpty())))
         {
            String name, type;
            if (isWrapped)
            {
               WrappedParameter wrappedParameter = returnParam.getWrappedParameters().get(0);
               name = wrappedParameter.getName().getLocalPart();
               type = wrappedParameter.getType();
            }
            else
            {
               name = returnParam.getXmlName().getLocalPart();
               type = returnParam.getJavaTypeName();
View Full Code Here

            String variable = variableMap.get(elementName);
            if (variable == null)
               throw new IllegalArgumentException("Could not determine variable name for element: " + elementName);

            WrappedParameter wrapped = new WrappedParameter(new QName(elementName), partMapping.getParamType(), variable, partMapping.getParamPosition());

            String parameterMode = wsdlMessageMapping.getParameterMode();
            if (parameterMode == null || parameterMode.length() < 2)
               throw new IllegalArgumentException("Invalid parameter mode for element: " + elementName);

            if (!"OUT".equals(parameterMode))
               wrappedParameters.add(wrapped);
            if (!"IN".equals(parameterMode))
            {
               wrapped.setHolder(true);
               // wrapped parameters can not be shared between request/response objects (accessors)
               if ("INOUT".equals(parameterMode))
                  wrapped = new WrappedParameter(wrapped);
               wrappedResponseParameters.add(wrapped);
            }
         }
         inMetaData.setWrappedParameters(wrappedParameters);
         wsdlPosition = wrappedParameters.size();
View Full Code Here

            if (variable == null)
               throw new IllegalArgumentException("Could not determine variable name for element: " + elementName);

            String wrappedType = returnValueMapping.getMethodReturnValue();
            QName element = new QName(elementName);
            WrappedParameter wrappedParameter = new WrappedParameter(element, wrappedType, variable, WrappedParameter.RETURN);
            wrappedResponseParameters.add(0, wrappedParameter);
         }

         outMetaData.setWrappedParameters(wrappedResponseParameters);
      }
View Full Code Here

         if (isWrapped)
         {
            QName wrappedElementName = getWebParamName(opMetaData, i, anWebParam);
            String variable = convertToVariable(wrappedElementName.getLocalPart());

            WrappedParameter wrappedParameter = new WrappedParameter(wrappedElementName, javaTypeName, variable, i);
            wrappedParameter.setTypeArguments(convertTypeArguments(javaType, genericType));

            if (mode != ParameterMode.OUT)
               wrappedParameters.add(wrappedParameter);

            if (mode != ParameterMode.IN)
            {
               wrappedParameter.setHolder(true);

               // WrappedParameters can not be shared between request/response objects (accessors)
               if (mode == ParameterMode.INOUT)
                  wrappedParameter = new WrappedParameter(wrappedParameter);
               wrappedOutputParameters.add(wrappedParameter);
            }

            processAttachmentAnnotationsWrapped(scanResult, i, wrappedParameter);
         }
         else
         {
            QName xmlName = getWebParamName(opMetaData, i, anWebParam);

            ParameterMetaData paramMetaData = new ParameterMetaData(opMetaData, xmlName, javaTypeName);
            paramMetaData.setInHeader(isHeader);
            paramMetaData.setIndex(i);
            paramMetaData.setMode(mode);

            /*
             * Note: The TCK enforces the following rule in the spec regarding
             * partName: "This is only used if the operation is rpc style or if
             * the operation is document style and the parameter style is BARE."
             *
             * This seems to be a flaw in the spec, because the intention is
             * obviously to prevent the ambiguity of wrapped parameters that
             * specify different partName values. There is, however, no reason
             * that this limitation should apply to header parameters since they
             * are never wrapped. In order to comply we adhere to this confusing
             * rule, although I will ask for clarification.
             */
            if (anWebParam != null && !opMetaData.isDocumentWrapped() && anWebParam.partName().length() > 0)
               paramMetaData.setPartName(anWebParam.partName());

            opMetaData.addParameter(paramMetaData);
            javaTypes.add(javaType);
            typeRefs.add(new TypeReference(xmlName, genericType, parameterAnnotations[i]));

            processAttachmentAnnotations(scanResult, i, paramMetaData);
            processMIMEBinding(epMetaData, opMetaData, paramMetaData);
         }
      }

      // Build result meta data
      Class returnType = method.getReturnType();
      Type genericReturnType = method.getGenericReturnType();
      String returnTypeName = returnType.getName();
      if (!(returnType == void.class))
      {
         if (opMetaData.isOneWay())
            throw new IllegalArgumentException("[JSR-181 2.5.1] The method '" + method.getName() + "' can not have a return value if it is marked OneWay");

         WebResult anWebResult = method.getAnnotation(WebResult.class);
         boolean isHeader = anWebResult != null && anWebResult.header();
         boolean isWrappedBody = opMetaData.isDocumentWrapped() && !isHeader;
         QName xmlName = getWebResultName(opMetaData, anWebResult);

         if (isWrappedBody)
         {
            WrappedParameter wrapped = new WrappedParameter(xmlName, returnTypeName, convertToVariable(xmlName.getLocalPart()), -1);
            wrapped.setTypeArguments(convertTypeArguments(returnType, genericReturnType));

            // insert at the beginning just for prettiness
            wrappedOutputParameters.add(0, wrapped);

            processAttachmentAnnotationsWrapped(scanResult, -1, wrapped);
View Full Code Here

               throw new WSException("Param Type " + paramType.getName() + " should not extend java.rmi.Remote");

            if (om.isDocumentWrapped() && !isHeaderParameter(opc, i))
            {
               QName xmlName = getXmlName(paramType, opc, i, null);
               wrappedParameters.add(new WrappedParameter(xmlName, paramType.getName(), convertToProperty(xmlName.getLocalPart()), i));
            }
            else
            {
               om.addParameter(getParameterMetaData(paramType, om, opc, i));
            }
         }

         // Handle return type
         Class returnType = m.getReturnType();
         if (void.class != returnType)
         {
            if (Remote.class.isAssignableFrom(returnType))
               throw new WSException("Return Type " + returnType.getName() + " should not extend java.rmi.Remote");

            if (om.isDocumentWrapped())
            {
               QName name = getReturnXmlName(opc, null);

               WrappedParameter wrapped = new WrappedParameter(name, returnType.getName(), convertToProperty(name.getLocalPart()), -1);
               ParameterMetaData retMetaData = om.getReturnParameter();
               retMetaData.getWrappedParameters().add(wrapped);
            }
            else
            {
View Full Code Here

TOP

Related Classes of org.jboss.ws.metadata.umdm.WrappedParameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.