Java Code Examples for org.apache.cxf.jaxrs.utils.ResourceUtils#getParameters()

The following examples show how to use org.apache.cxf.jaxrs.utils.ResourceUtils#getParameters() . 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: JAXRSParameterNameProvider.java    From cxf with Apache License 2.0 6 votes vote down vote up
@Override
public List<String> getParameterNames(final Method method) {
    final List< Parameter > parameters = ResourceUtils.getParameters(method);
    final List< String > parameterNames = new ArrayList<>();

    for (int i = 0; i < parameters.size(); ++i) {
        final StringBuilder sb = new StringBuilder();
        sb.append("arg").append(i);
        sb.append('(');

        Parameter parameter = parameters.get(i);
        if (parameter.getName() != null) {
            sb.append(parameter.getType().toString());
            sb.append("(\"").append(parameter.getName()).append("\")");
            sb.append(' ');
        }
        sb.append(method.getParameterTypes()[i].getSimpleName());

        sb.append(')');
        parameterNames.add(sb.toString());
    }

    return parameterNames;
}
 
Example 2
Source File: OperationResourceInfo.java    From cxf with Apache License 2.0 5 votes vote down vote up
public OperationResourceInfo(Method mInvoke, Method mAnnotated, ClassResourceInfo cri) {
    methodToInvoke = mInvoke;
    annotatedMethod = mAnnotated;
    if (mAnnotated != null) {
        parameters = ResourceUtils.getParameters(mAnnotated);
        nameBindings = AnnotationUtils.getNameBindings(mAnnotated.getAnnotations());
    }
    classResourceInfo = cri;
    checkMediaTypes(null, null);
    checkEncoded();
    checkDefaultParameterValue();
    checkOneway();
    checkSuspended();
    initActualMethodProperties();
}