本文整理匯總了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);
}
示例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);
}