當前位置: 首頁>>代碼示例>>Java>>正文


Java WebParam.name方法代碼示例

本文整理匯總了Java中javax.jws.WebParam.name方法的典型用法代碼示例。如果您正苦於以下問題:Java WebParam.name方法的具體用法?Java WebParam.name怎麽用?Java WebParam.name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.jws.WebParam的用法示例。


在下文中一共展示了WebParam.name方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getInParameterName

import javax.jws.WebParam; //導入方法依賴的package包/類
@Override
public QName getInParameterName(OperationInfo op, Method method, int paramNumber)
{
	Annotation[][] annos = method.getParameterAnnotations();
	if( annos.length > paramNumber )
	{
		Annotation[] paramAnnos = annos[paramNumber];
		for( Annotation anno : paramAnnos )
		{
			if( anno instanceof WebParam )
			{
				WebParam webParam = (WebParam) anno;
				String targetNs = webParam.targetNamespace();
				if( Check.isEmpty(targetNs) )
				{
					targetNs = op.getName().getNamespaceURI();
				}
				return new QName(targetNs, webParam.name());
			}
		}
	}

	return new QName(op.getName().getNamespaceURI(), "in" + paramNumber);
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:25,代碼來源:XFireCompatabilityConfiguration.java

示例2: getParameterName

import javax.jws.WebParam; //導入方法依賴的package包/類
private String getParameterName(Annotation[] annotations) {
    for (Annotation a : annotations) {
        if (a instanceof WebParam) {
            WebParam webparam = (WebParam) a;
            return webparam.name();
        }
    }
    fail("Missing WebParam annotation");
    return null;
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:11,代碼來源:ParameterNamesTest.java

示例3: getParameterName

import javax.jws.WebParam; //導入方法依賴的package包/類
private String getParameterName(Annotation[] paramAnnotations, Method method) {
    for (Annotation a : paramAnnotations) {
        if (a instanceof WebParam) {
            WebParam webparam = (WebParam) a;
            return webparam.name();
        }
    }
    fail("Missing WebParam annotation in method " + method.getName());
    return null;
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:11,代碼來源:NullArgumentTestBase.java

示例4: collectRequestBeanMembers

import javax.jws.WebParam; //導入方法依賴的package包/類
/**
     * Computes request bean members for a method. Collects all IN and INOUT
     * parameters as request bean fields. In this process, if a parameter
     * has any known JAXB annotations they are collected as well.
     * Special processing for @XmlElement annotation is done.
     *
     * @param method SEI method for which request bean members are computed
     * @return List of request bean members
     */
    public List<A> collectRequestBeanMembers(M method) {

        List<A> requestMembers = new ArrayList<A>();
        int paramIndex = -1;

        for (T param : nav.getMethodParameters(method)) {
            paramIndex++;
            WebParam webParam = annReader.getMethodParameterAnnotation(WebParam.class, method, paramIndex, null);
            if (webParam != null && (webParam.header() || webParam.mode().equals(WebParam.Mode.OUT))) {
                continue;
            }
            T holderType = getHolderValueType(param);
//            if (holderType != null && webParam != null && webParam.mode().equals(WebParam.Mode.IN)) {
//                // Should we flag an error - holder cannot be IN part ??
//                continue;
//            }

            T paramType = (holderType != null) ? holderType : getSafeType(param);
            String paramName = (webParam != null && webParam.name().length() > 0)
                    ? webParam.name() : "arg"+paramIndex;
            String paramNamespace = (webParam != null && webParam.targetNamespace().length() > 0)
                    ? webParam.targetNamespace() : EMTPY_NAMESPACE_ID;

            // Collect JAXB annotations on a parameter
            List<Annotation> jaxbAnnotation = collectJAXBAnnotations(method, paramIndex);

            // If a parameter contains @XmlElement, process it.
            processXmlElement(jaxbAnnotation, paramName, paramNamespace, paramType);
            A member = factory.createWrapperBeanMember(paramType,
                    getPropertyName(paramName), jaxbAnnotation);
            requestMembers.add(member);
        }
        return requestMembers;
    }
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:44,代碼來源:AbstractWrapperBeanGenerator.java

示例5: collectResponseBeanMembers

import javax.jws.WebParam; //導入方法依賴的package包/類
/**
 * Computes response bean members for a method. Collects all OUT and INOUT
 * parameters as response bean fields. In this process, if a parameter
 * has any known JAXB annotations they are collected as well.
 * Special processing for @XmlElement annotation is done.
 *
 * @param method SEI method for which response bean members are computed
 * @return List of response bean members
 */
public List<A> collectResponseBeanMembers(M method) {

    List<A> responseMembers = new ArrayList<A>();

    // return that need to be part response wrapper bean
    String responseElementName = RETURN;
    String responseNamespace = EMTPY_NAMESPACE_ID;
    boolean isResultHeader = false;
    WebResult webResult = annReader.getMethodAnnotation(WebResult.class, method ,null);
    if (webResult != null) {
        if (webResult.name().length() > 0) {
            responseElementName = webResult.name();
        }
        if (webResult.targetNamespace().length() > 0) {
            responseNamespace = webResult.targetNamespace();
        }
        isResultHeader = webResult.header();
    }
    T returnType = getSafeType(nav.getReturnType(method));
    if (!isVoidType(returnType) && !isResultHeader) {
        List<Annotation> jaxbRespAnnotations = collectJAXBAnnotations(method);
        processXmlElement(jaxbRespAnnotations, responseElementName, responseNamespace, returnType);
        responseMembers.add(factory.createWrapperBeanMember(returnType, getPropertyName(responseElementName), jaxbRespAnnotations));
    }

    // Now parameters that need to be part response wrapper bean
    int paramIndex = -1;
    for (T param : nav.getMethodParameters(method)) {
        paramIndex++;

        T paramType = getHolderValueType(param);
        WebParam webParam = annReader.getMethodParameterAnnotation(WebParam.class, method, paramIndex, null);
        if (paramType == null || (webParam != null && webParam.header())) {
            continue;       // not a holder or a header - so don't add it
        }

        String paramName = (webParam != null && webParam.name().length() > 0)
                ? webParam.name() : "arg"+paramIndex;
        String paramNamespace = (webParam != null && webParam.targetNamespace().length() > 0)
                ? webParam.targetNamespace() : EMTPY_NAMESPACE_ID;
        List<Annotation> jaxbAnnotation = collectJAXBAnnotations(method, paramIndex);
        processXmlElement(jaxbAnnotation, paramName, paramNamespace, paramType);
        A member = factory.createWrapperBeanMember(paramType,
                getPropertyName(paramName), jaxbAnnotation);
        responseMembers.add(member);
    }

    return responseMembers;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:59,代碼來源:AbstractWrapperBeanGenerator.java


注:本文中的javax.jws.WebParam.name方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。