本文整理匯總了Java中javax.jws.WebParam.Mode方法的典型用法代碼示例。如果您正苦於以下問題:Java WebParam.Mode方法的具體用法?Java WebParam.Mode怎麽用?Java WebParam.Mode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.jws.WebParam
的用法示例。
在下文中一共展示了WebParam.Mode方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getModeParameterCount
import javax.jws.WebParam; //導入方法依賴的package包/類
protected int getModeParameterCount(ExecutableElement method, WebParam.Mode mode) {
WebParam webParam;
int cnt = 0;
for (VariableElement param : method.getParameters()) {
webParam = param.getAnnotation(WebParam.class);
if (webParam != null) {
if (webParam.header())
continue;
if (isEquivalentModes(mode, webParam.mode()))
cnt++;
} else {
if (isEquivalentModes(mode, WebParam.Mode.IN)) {
cnt++;
}
}
}
return cnt;
}
示例2: isLegalParameter
import javax.jws.WebParam; //導入方法依賴的package包/類
protected boolean isLegalParameter(VariableElement param,
ExecutableElement method,
TypeElement typeElement,
int paramIndex) {
if (!isLegalType(param.asType())) {
builder.processError(WebserviceapMessages.WEBSERVICEAP_METHOD_PARAMETER_TYPES_CANNOT_IMPLEMENT_REMOTE(typeElement.getQualifiedName(),
method.getSimpleName(),
param.getSimpleName(),
param.asType().toString()), param);
return false;
}
TypeMirror holderType;
holderType = builder.getHolderValueType(param.asType());
WebParam webParam = param.getAnnotation(WebParam.class);
WebParam.Mode mode = null;
if (webParam != null)
mode = webParam.mode();
if (holderType != null) {
if (mode != null && mode == WebParam.Mode.IN)
builder.processError(WebserviceapMessages.WEBSERVICEAP_HOLDER_PARAMETERS_MUST_NOT_BE_IN_ONLY(typeElement.getQualifiedName(), method.toString(), paramIndex), param);
} else if (mode != null && mode != WebParam.Mode.IN) {
builder.processError(WebserviceapMessages.WEBSERVICEAP_NON_IN_PARAMETERS_MUST_BE_HOLDER(typeElement.getQualifiedName(), method.toString(), paramIndex), param);
}
return true;
}
示例3: isEquivalentModes
import javax.jws.WebParam; //導入方法依賴的package包/類
protected boolean isEquivalentModes(WebParam.Mode mode1, WebParam.Mode mode2) {
if (mode1.equals(mode2))
return true;
assert mode1 == WebParam.Mode.IN || mode1 == WebParam.Mode.OUT;
return (mode1 == WebParam.Mode.IN && mode2 != WebParam.Mode.OUT) || (mode1 == WebParam.Mode.OUT && mode2 != WebParam.Mode.IN);
}