Package com.sun.research.ws.wadl

Examples of com.sun.research.ws.wadl.Request


    }

    private com.sun.research.ws.wadl.Method generateMethod(AbstractResource r, final Map<String, Param> wadlResourceParams, final AbstractResourceMethod m) {
        com.sun.research.ws.wadl.Method wadlMethod = _wadlGenerator.createMethod(r, m);
        // generate the request part
        Request wadlRequest = generateRequest(r, m, wadlResourceParams);
        if (wadlRequest != null) {
            wadlMethod.setRequest(wadlRequest);
        }
        // generate the response part
        final List<Response> responses = generateResponses(r, m);
View Full Code Here


                                    Map<String, Param> wadlResourceParams) {
        if (m.getParameters().isEmpty()) {
            return null;
        }

        Request wadlRequest = _wadlGenerator.createRequest(r, m);

        for (Parameter p : m.getParameters()) {
            if (p.getSource() == Parameter.Source.ENTITY) {
                for (MediaType mediaType : m.getSupportedInputTypes()) {
                    setRepresentationForMediaType(r, m, mediaType, wadlRequest);
                }
            } else if (p.getAnnotation().annotationType() == FormParam.class) {
                // Use application/x-www-form-urlencoded if no @Consumes
                List<MediaType> supportedInputTypes = m.getSupportedInputTypes();
                if (supportedInputTypes.isEmpty()
                        || (supportedInputTypes.size() == 1 && supportedInputTypes.get(0).isWildcardType())) {
                    supportedInputTypes = Collections.singletonList(MediaType.APPLICATION_FORM_URLENCODED_TYPE);
                }

                for (MediaType mediaType : supportedInputTypes) {
                    final Representation wadlRepresentation = setRepresentationForMediaType(r, m, mediaType, wadlRequest);
                    if (getParamByName(wadlRepresentation.getParam(), p.getSourceName()) == null) {
                        final Param wadlParam = generateParam(r, m, p);
                        if (wadlParam != null) {
                            wadlRepresentation.getParam().add(wadlParam);
                        }
                    }
                }
            } else if (p.getAnnotation().annotationType().getName().equals("com.sun.jersey.multipart.FormDataParam")) { // jersey-multipart support
                // Use multipart/form-data if no @Consumes
                List<MediaType> supportedInputTypes = m.getSupportedInputTypes();
                if (supportedInputTypes.isEmpty()
                        || (supportedInputTypes.size() == 1 && supportedInputTypes.get(0).isWildcardType())) {
                    supportedInputTypes = Collections.singletonList(MediaType.MULTIPART_FORM_DATA_TYPE);
                }

                for (MediaType mediaType : supportedInputTypes) {
                    final Representation wadlRepresentation = setRepresentationForMediaType(r, m, mediaType, wadlRequest);
                    if (getParamByName(wadlRepresentation.getParam(), p.getSourceName()) == null) {
                        final Param wadlParam = generateParam(r, m, p);
                        if (wadlParam != null) {
                            wadlRepresentation.getParam().add(wadlParam);
                        }
                    }
                }
            } else {
                Param wadlParam = generateParam(r, m, p);
                if (wadlParam == null) {
                    continue;
                }
                if (wadlParam.getStyle() == ParamStyle.TEMPLATE || wadlParam.getStyle() == ParamStyle.MATRIX) {
                    wadlResourceParams.put(wadlParam.getName(), wadlParam);
                } else {
                    wadlRequest.getParam().add(wadlParam);
                }
            }
        }
        if (wadlRequest.getRepresentation().size() + wadlRequest.getParam().size() == 0) {
            return null;
        } else {
            return wadlRequest;
        }
    }
View Full Code Here

        return wadlRepresentation;
    }

    @Override
    public Request createRequest(AbstractResource r, AbstractResourceMethod m) {
        return new Request();
    }
View Full Code Here

        return wadlRepresentation;
    }

    @Override
    public Request createRequest(org.glassfish.jersey.server.model.Resource r, ResourceMethod m) {
        return new Request();
    }
View Full Code Here

            }
            com.sun.research.ws.wadl.Method wadlMethod = _wadlGenerator.createMethod(r, m);


            // generate the request part
            Request wadlRequest = generateRequest(r, m, wadlResourceParams);
            if (wadlRequest != null) {
                wadlMethod.setRequest(wadlRequest);
            }
            // generate the response part
            final List<Response> responses = generateResponses(r, m);
View Full Code Here

        try {
            if (m.getInvocable().getParameters().isEmpty()) {
                return null;
            }

            Request wadlRequest = _wadlGenerator.createRequest(r, m);

            for (Parameter p : m.getInvocable().getParameters()) {
                if (p.getSource() == Parameter.Source.ENTITY) {
                    for (MediaType mediaType : m.getConsumedTypes()) {
                        setRepresentationForMediaType(r, m, mediaType, wadlRequest);
                    }
                } else if (p.getSourceAnnotation().annotationType() == FormParam.class) {
                    // Use application/x-www-form-urlencoded if no @Consumes
                    List<MediaType> supportedInputTypes = m.getConsumedTypes();
                    if (supportedInputTypes.isEmpty()
                            || (supportedInputTypes.size() == 1 && supportedInputTypes.get(0).isWildcardType())) {
                        supportedInputTypes = Collections.singletonList(MediaType.APPLICATION_FORM_URLENCODED_TYPE);
                    }

                    for (MediaType mediaType : supportedInputTypes) {
                        final Representation wadlRepresentation = setRepresentationForMediaType(r, m, mediaType, wadlRequest);
                        if (getParamByName(wadlRepresentation.getParam(), p.getSourceName()) == null) {
                            final Param wadlParam = generateParam(r, m, p);
                            if (wadlParam != null) {
                                wadlRepresentation.getParam().add(wadlParam);
                            }
                        }
                    }
                } else if (p.getSourceAnnotation().annotationType().getName().equals("org.glassfish.jersey.media.multipart" +
                        ".FormDataParam")) { // jersey-multipart support
                    // Use multipart/form-data if no @Consumes
                    List<MediaType> supportedInputTypes = m.getConsumedTypes();
                    if (supportedInputTypes.isEmpty()
                            || (supportedInputTypes.size() == 1 && supportedInputTypes.get(0).isWildcardType())) {
                        supportedInputTypes = Collections.singletonList(MediaType.MULTIPART_FORM_DATA_TYPE);
                    }

                    for (MediaType mediaType : supportedInputTypes) {
                        final Representation wadlRepresentation = setRepresentationForMediaType(r, m, mediaType, wadlRequest);
                        if (getParamByName(wadlRepresentation.getParam(), p.getSourceName()) == null) {
                            final Param wadlParam = generateParam(r, m, p);
                            if (wadlParam != null) {
                                wadlRepresentation.getParam().add(wadlParam);
                            }
                        }
                    }
                } else {
                    Param wadlParam = generateParam(r, m, p);
                    if (wadlParam == null) {
                        continue;
                    }
                    if (wadlParam.getStyle() == ParamStyle.TEMPLATE || wadlParam.getStyle() == ParamStyle.MATRIX) {
                        wadlResourceParams.put(wadlParam.getName(), wadlParam);
                    } else {
                        wadlRequest.getParam().add(wadlParam);
                    }
                }
            }
            if (wadlRequest.getRepresentation().size() + wadlRequest.getParam().size() == 0) {
                return null;
            } else {
                return wadlRequest;
            }
        } catch (Exception e) {
View Full Code Here

        return wadlRepresentation;
    }

    @Override
    public Request createRequest(AbstractResource r, AbstractResourceMethod m) {
        return new Request();
    }
View Full Code Here

    }

    private com.sun.research.ws.wadl.Method generateMethod(AbstractResource r, final Map<String, Param> wadlResourceParams, final AbstractResourceMethod m) {
        com.sun.research.ws.wadl.Method wadlMethod = _wadlGenerator.createMethod(r, m);
        // generate the request part
        Request wadlRequest = generateRequest(r, m, wadlResourceParams);
        if (wadlRequest != null) {
            wadlMethod.setRequest(wadlRequest);
        }
        // generate the response part
        final List<Response> responses = generateResponses(r, m);
View Full Code Here

                                    Map<String, Param> wadlResourceParams) {
        if (m.getParameters().isEmpty()) {
            return null;
        }

        Request wadlRequest = _wadlGenerator.createRequest(r, m);

        for (Parameter p : m.getParameters()) {
            if (p.getSource() == Parameter.Source.ENTITY) {
                for (MediaType mediaType : m.getSupportedInputTypes()) {
                    setRepresentationForMediaType(r, m, mediaType, wadlRequest);
                }
            } else if (p.getAnnotation().annotationType() == FormParam.class) {
                // Use application/x-www-form-urlencoded if no @Consumes
                List<MediaType> supportedInputTypes = m.getSupportedInputTypes();
                if (supportedInputTypes.isEmpty()
                        || (supportedInputTypes.size() == 1 && supportedInputTypes.get(0).isWildcardType())) {
                    supportedInputTypes = Collections.singletonList(MediaType.APPLICATION_FORM_URLENCODED_TYPE);
                }

                for (MediaType mediaType : supportedInputTypes) {
                    final Representation wadlRepresentation = setRepresentationForMediaType(r, m, mediaType, wadlRequest);
                    if (getParamByName(wadlRepresentation.getParam(), p.getSourceName()) == null) {
                        final Param wadlParam = generateParam(r, m, p);
                        if (wadlParam != null) {
                            wadlRepresentation.getParam().add(wadlParam);
                        }
                    }
                }
            } else if (p.getAnnotation().annotationType().getName().equals("com.sun.jersey.multipart.FormDataParam")) { // jersey-multipart support
                // Use multipart/form-data if no @Consumes
                List<MediaType> supportedInputTypes = m.getSupportedInputTypes();
                if (supportedInputTypes.isEmpty()
                        || (supportedInputTypes.size() == 1 && supportedInputTypes.get(0).isWildcardType())) {
                    supportedInputTypes = Collections.singletonList(MediaType.MULTIPART_FORM_DATA_TYPE);
                }

                for (MediaType mediaType : supportedInputTypes) {
                    final Representation wadlRepresentation = setRepresentationForMediaType(r, m, mediaType, wadlRequest);
                    if (getParamByName(wadlRepresentation.getParam(), p.getSourceName()) == null) {
                        final Param wadlParam = generateParam(r, m, p);
                        if (wadlParam != null) {
                            wadlRepresentation.getParam().add(wadlParam);
                        }
                    }
                }
            } else {
                Param wadlParam = generateParam(r, m, p);
                if (wadlParam == null) {
                    continue;
                }
                if (wadlParam.getStyle() == ParamStyle.TEMPLATE) {
                    wadlResourceParams.put(wadlParam.getName(), wadlParam);
                } else {
                    wadlRequest.getParam().add(wadlParam);
                }
            }
        }
        if (wadlRequest.getRepresentation().size() + wadlRequest.getParam().size() == 0) {
            return null;
        } else {
            return wadlRequest;
        }
    }
View Full Code Here

    }

    private com.sun.research.ws.wadl.Method generateMethod(AbstractResource r, final Map<String, Param> wadlResourceParams, final AbstractResourceMethod m) {
        com.sun.research.ws.wadl.Method wadlMethod = _wadlGenerator.createMethod(r, m);
        // generate the request part
        Request wadlRequest = generateRequest(r, m, wadlResourceParams);
        if (wadlRequest != null) {
            wadlMethod.setRequest(wadlRequest);
        }
        // generate the response part
        Response wadlResponse = generateResponse(r, m);
View Full Code Here

TOP

Related Classes of com.sun.research.ws.wadl.Request

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.