Java Code Examples for javax.jws.WebParam#mode()

The following examples show how to use javax.jws.WebParam#mode() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WebServiceVisitor.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 2
Source File: JaxWsServiceConfiguration.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Override
public String getResponseWrapperPartName(OperationInfo op, Method method) {
    method = getDeclaredMethod(method);
    WebResult webResult = getWebResult(method);
    ResponseWrapper rw = method.getAnnotation(ResponseWrapper.class);
    if (rw != null) {
        String pn = getWithReflection(ResponseWrapper.class, rw, "partName");
        if (pn != null) {
            return pn;
        }
    }
    int countOut = 0;
    int countHeaders = 0;

    if (webResult != null
        && webResult.header()) {
        countHeaders++;
    } else if (method.getReturnType() != Void.TYPE) {
        countOut++;
    }

    for (int x = 0; x < method.getParameterTypes().length; x++) {
        WebParam parm = getWebParam(method, x);
        if (parm != null) {
            if (parm.header()) {
                countHeaders++;
            }
            if (parm.mode() != WebParam.Mode.IN) {
                countOut++;
            }
        }
    }
    if (countHeaders > 0 && countOut == 0) {
        //all outs are headers, thus it's an empty body part
        //thus return the default for an empty part of "result"
        return "result";
    }
    return null;
}
 
Example 3
Source File: WebServiceVisitor.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected VariableElement getOutParameter(ExecutableElement method) {
    WebParam webParam;
    for (VariableElement param : method.getParameters()) {
        webParam = param.getAnnotation(WebParam.class);
        if (webParam != null && webParam.mode() != WebParam.Mode.IN) {
            return param;
        }
    }
    return null;
}
 
Example 4
Source File: WebServiceVisitor.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 5
Source File: WebServiceVisitor.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected VariableElement getOutParameter(ExecutableElement method) {
    WebParam webParam;
    for (VariableElement param : method.getParameters()) {
        webParam = param.getAnnotation(WebParam.class);
        if (webParam != null && webParam.mode() != WebParam.Mode.IN) {
            return param;
        }
    }
    return null;
}
 
Example 6
Source File: WebServiceVisitor.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 7
Source File: WebServiceVisitor.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected VariableElement getOutParameter(ExecutableElement method) {
    WebParam webParam;
    for (VariableElement param : method.getParameters()) {
        webParam = param.getAnnotation(WebParam.class);
        if (webParam != null && webParam.mode() != WebParam.Mode.IN) {
            return param;
        }
    }
    return null;
}
 
Example 8
Source File: WebServiceVisitor.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 9
Source File: WebServiceVisitor.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected VariableElement getOutParameter(ExecutableElement method) {
    WebParam webParam;
    for (VariableElement param : method.getParameters()) {
        webParam = param.getAnnotation(WebParam.class);
        if (webParam != null && webParam.mode() != WebParam.Mode.IN) {
            return param;
        }
    }
    return null;
}
 
Example 10
Source File: WebServiceVisitor.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 11
Source File: WebServiceVisitor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected VariableElement getOutParameter(ExecutableElement method) {
    WebParam webParam;
    for (VariableElement param : method.getParameters()) {
        webParam = param.getAnnotation(WebParam.class);
        if (webParam != null && webParam.mode() != WebParam.Mode.IN) {
            return param;
        }
    }
    return null;
}
 
Example 12
Source File: WebServiceVisitor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 13
Source File: WebServiceVisitor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected VariableElement getOutParameter(ExecutableElement method) {
    WebParam webParam;
    for (VariableElement param : method.getParameters()) {
        webParam = param.getAnnotation(WebParam.class);
        if (webParam != null && webParam.mode() != WebParam.Mode.IN) {
            return param;
        }
    }
    return null;
}
 
Example 14
Source File: WebServiceVisitor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 15
Source File: WebServiceVisitor.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected VariableElement getOutParameter(ExecutableElement method) {
    WebParam webParam;
    for (VariableElement param : method.getParameters()) {
        webParam = param.getAnnotation(WebParam.class);
        if (webParam != null && webParam.mode() != WebParam.Mode.IN) {
            return param;
        }
    }
    return null;
}
 
Example 16
Source File: WebServiceVisitor.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 17
Source File: WebServiceVisitor.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected VariableElement getOutParameter(ExecutableElement method) {
    WebParam webParam;
    for (VariableElement param : method.getParameters()) {
        webParam = param.getAnnotation(WebParam.class);
        if (webParam != null && webParam.mode() != WebParam.Mode.IN) {
            return param;
        }
    }
    return null;
}