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


Java XmlElement.namespace方法代碼示例

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


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

示例1: getReturnQName

import javax.xml.bind.annotation.XmlElement; //導入方法依賴的package包/類
private static QName getReturnQName(Method method, WebResult webResult, XmlElement xmlElem) {
    String webResultName = null;
    if (webResult != null && webResult.name().length() > 0) {
        webResultName = webResult.name();
    }
    String xmlElemName = null;
    if (xmlElem != null && !xmlElem.name().equals("##default")) {
        xmlElemName = xmlElem.name();
    }
    if (xmlElemName != null && webResultName != null && !xmlElemName.equals(webResultName)) {
        throw new RuntimeModelerException("@XmlElement(name)="+xmlElemName+" and @WebResult(name)="+webResultName+" are different for method " +method);
    }
    String localPart = RETURN;
    if (webResultName != null) {
        localPart = webResultName;
    } else if (xmlElemName != null) {
        localPart =  xmlElemName;
    }

    String webResultNS = null;
    if (webResult != null && webResult.targetNamespace().length() > 0) {
        webResultNS = webResult.targetNamespace();
    }
    String xmlElemNS = null;
    if (xmlElem != null && !xmlElem.namespace().equals("##default")) {
        xmlElemNS = xmlElem.namespace();
    }
    if (xmlElemNS != null && webResultNS != null && !xmlElemNS.equals(webResultNS)) {
        throw new RuntimeModelerException("@XmlElement(namespace)="+xmlElemNS+" and @WebResult(targetNamespace)="+webResultNS+" are different for method " +method);
    }
    String ns = "";
    if (webResultNS != null) {
        ns = webResultNS;
    } else if (xmlElemNS != null) {
        ns =  xmlElemNS;
    }

    return new QName(ns, localPart);
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:40,代碼來源:RuntimeModeler.java

示例2: getParameterQName

import javax.xml.bind.annotation.XmlElement; //導入方法依賴的package包/類
private static QName getParameterQName(Method method, WebParam webParam, XmlElement xmlElem, String paramDefault) {
    String webParamName = null;
    if (webParam != null && webParam.name().length() > 0) {
        webParamName = webParam.name();
    }
    String xmlElemName = null;
    if (xmlElem != null && !xmlElem.name().equals("##default")) {
        xmlElemName = xmlElem.name();
    }
    if (xmlElemName != null && webParamName != null && !xmlElemName.equals(webParamName)) {
        throw new RuntimeModelerException("@XmlElement(name)="+xmlElemName+" and @WebParam(name)="+webParamName+" are different for method " +method);
    }
    String localPart = paramDefault;
    if (webParamName != null) {
        localPart = webParamName;
    } else if (xmlElemName != null) {
        localPart =  xmlElemName;
    }

    String webParamNS = null;
    if (webParam != null && webParam.targetNamespace().length() > 0) {
        webParamNS = webParam.targetNamespace();
    }
    String xmlElemNS = null;
    if (xmlElem != null && !xmlElem.namespace().equals("##default")) {
        xmlElemNS = xmlElem.namespace();
    }
    if (xmlElemNS != null && webParamNS != null && !xmlElemNS.equals(webParamNS)) {
        throw new RuntimeModelerException("@XmlElement(namespace)="+xmlElemNS+" and @WebParam(targetNamespace)="+webParamNS+" are different for method " +method);
    }
    String ns = "";
    if (webParamNS != null) {
        ns = webParamNS;
    } else if (xmlElemNS != null) {
        ns =  xmlElemNS;
    }

    return new QName(ns, localPart);
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:40,代碼來源:RuntimeModeler.java


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