@Override public Request createRequest(org.glassfish.jersey.server.model.Resource r, ResourceMethod m) { return new Request(); }
private Request generateRequest(org.glassfish.jersey.server.model.Resource parentResource, final org.glassfish.jersey.server.model.ResourceMethod resourceMethod, Map<String, Param> wadlResourceParams) { try { final List<Parameter> requestParams = new LinkedList<>(resourceMethod.getInvocable().getParameters()); // Adding handler instance parameters to the list of potential request parameters. requestParams.addAll(resourceMethod.getInvocable().getHandler().getParameters()); if (requestParams.isEmpty()) { return null; } Request wadlRequest = _wadlGenerator.createRequest(parentResource, resourceMethod); processRequestParameters(parentResource, resourceMethod, wadlResourceParams, requestParams, wadlRequest); if (wadlRequest.getRepresentation().size() + wadlRequest.getParam().size() == 0) { return null; } else { return wadlRequest; } } catch (Exception e) { throw new ProcessingException(LocalizationMessages.ERROR_WADL_BUILDER_GENERATION_REQUEST( resourceMethod, parentResource), e); } }
/** * Create the wadl {@link Representation} for the specified {@link MediaType} if not yet * existing for the wadl {@link Request} and return it. * @param r the resource * @param m the resource method * @param mediaType an accepted media type of the resource method * @param wadlRequest the wadl request the wadl representation is to be created for (if not yet existing). * @author Martin Grotzke * @return the wadl request representation for the specified {@link MediaType}. */ private Representation setRepresentationForMediaType(AbstractResource r, final AbstractResourceMethod m, MediaType mediaType, Request wadlRequest) { Representation wadlRepresentation = getRepresentationByMediaType(wadlRequest.getRepresentation(), mediaType); if (wadlRepresentation == null) { wadlRepresentation = _wadlGenerator.createRequestRepresentation(r, m, mediaType); wadlRequest.getRepresentation().add(wadlRepresentation); } return wadlRepresentation; }
wadlResourceParams.put(wadlParam.getName(), wadlParam); } else { wadlRequest.getParam().add(wadlParam);
/** * Create the wadl {@link Representation} for the specified {@link MediaType} if not yet existing for the wadl {@link Request} * and return it. * * @param r the resource * @param m the resource method * @param mediaType an accepted media type of the resource method * @param wadlRequest the wadl request the wadl representation is to be created for (if not yet existing). * @return the wadl request representation for the specified {@link MediaType}. */ private Representation setRepresentationForMediaType(org.glassfish.jersey.server.model.Resource r, final org.glassfish.jersey.server.model.ResourceMethod m, MediaType mediaType, Request wadlRequest) { try { Representation wadlRepresentation = getRepresentationByMediaType(wadlRequest.getRepresentation(), mediaType); if (wadlRepresentation == null) { wadlRepresentation = _wadlGenerator.createRequestRepresentation(r, m, mediaType); wadlRequest.getRepresentation().add(wadlRepresentation); } return wadlRepresentation; } catch (Exception e) { throw new ProcessingException(LocalizationMessages.ERROR_WADL_BUILDER_GENERATION_REQUEST_MEDIA_TYPE(mediaType, m, r), e); } }
wadlResourceParams.put(wadlParam.getName(), wadlParam); } else { wadlRequest.getParam().add(wadlParam);
private Request generateRequest(org.glassfish.jersey.server.model.Resource parentResource, final org.glassfish.jersey.server.model.ResourceMethod resourceMethod, Map<String, Param> wadlResourceParams) { try { final List<Parameter> requestParams = new LinkedList<>(resourceMethod.getInvocable().getParameters()); // Adding handler instance parameters to the list of potential request parameters. requestParams.addAll(resourceMethod.getInvocable().getHandler().getParameters()); if (requestParams.isEmpty()) { return null; } Request wadlRequest = _wadlGenerator.createRequest(parentResource, resourceMethod); processRequestParameters(parentResource, resourceMethod, wadlResourceParams, requestParams, wadlRequest); if (wadlRequest.getRepresentation().size() + wadlRequest.getParam().size() == 0) { return null; } else { return wadlRequest; } } catch (Exception e) { throw new ProcessingException(LocalizationMessages.ERROR_WADL_BUILDER_GENERATION_REQUEST( resourceMethod, parentResource), e); } }
@Override public Request createRequest(org.glassfish.jersey.server.model.Resource r, ResourceMethod m) { return new Request(); }
/** * Create the wadl {@link Representation} for the specified {@link MediaType} if not yet existing for the wadl {@link Request} * and return it. * * @param r the resource * @param m the resource method * @param mediaType an accepted media type of the resource method * @param wadlRequest the wadl request the wadl representation is to be created for (if not yet existing). * @return the wadl request representation for the specified {@link MediaType}. */ private Representation setRepresentationForMediaType(org.glassfish.jersey.server.model.Resource r, final org.glassfish.jersey.server.model.ResourceMethod m, MediaType mediaType, Request wadlRequest) { try { Representation wadlRepresentation = getRepresentationByMediaType(wadlRequest.getRepresentation(), mediaType); if (wadlRepresentation == null) { wadlRepresentation = _wadlGenerator.createRequestRepresentation(r, m, mediaType); wadlRequest.getRepresentation().add(wadlRepresentation); } return wadlRepresentation; } catch (Exception e) { throw new ProcessingException(LocalizationMessages.ERROR_WADL_BUILDER_GENERATION_REQUEST_MEDIA_TYPE(mediaType, m, r), e); } }
wadlResourceParams.put(wadlParam.getName(), wadlParam); } else { wadlRequest.getParam().add(wadlParam);
wadlResourceParams.put(wadlParam.getName(), wadlParam); } else { wadlRequest.getParam().add(wadlParam); if (wadlRequest.getRepresentation().size() + wadlRequest.getParam().size() == 0) { return null; } else {
/** * Create an instance of {@link Request } * */ public Request createRequest() { return new Request(); }
/** * Create the wadl {@link Representation} for the specified {@link MediaType} if not yet existing for the wadl {@link Request} * and return it. * * @param r the resource * @param m the resource method * @param mediaType an accepted media type of the resource method * @param wadlRequest the wadl request the wadl representation is to be created for (if not yet existing). * @return the wadl request representation for the specified {@link MediaType}. */ private Representation setRepresentationForMediaType(org.glassfish.jersey.server.model.Resource r, final org.glassfish.jersey.server.model.ResourceMethod m, MediaType mediaType, Request wadlRequest) { try { Representation wadlRepresentation = getRepresentationByMediaType(wadlRequest.getRepresentation(), mediaType); if (wadlRepresentation == null) { wadlRepresentation = _wadlGenerator.createRequestRepresentation(r, m, mediaType); wadlRequest.getRepresentation().add(wadlRepresentation); } return wadlRepresentation; } catch (Exception e) { throw new ProcessingException(LocalizationMessages.ERROR_WADL_BUILDER_GENERATION_REQUEST_MEDIA_TYPE(mediaType, m, r), e); } }
wadlResourceParams.put(wadlParam.getName(), wadlParam); } else { wadlRequest.getParam().add(wadlParam);
private Request generateRequest(org.glassfish.jersey.server.model.Resource parentResource, final org.glassfish.jersey.server.model.ResourceMethod resourceMethod, Map<String, Param> wadlResourceParams) { try { final List<Parameter> requestParams = new LinkedList<>(resourceMethod.getInvocable().getParameters()); // Adding handler instance parameters to the list of potential request parameters. requestParams.addAll(resourceMethod.getInvocable().getHandler().getParameters()); if (requestParams.isEmpty()) { return null; } Request wadlRequest = _wadlGenerator.createRequest(parentResource, resourceMethod); processRequestParameters(parentResource, resourceMethod, wadlResourceParams, requestParams, wadlRequest); if (wadlRequest.getRepresentation().size() + wadlRequest.getParam().size() == 0) { return null; } else { return wadlRequest; } } catch (Exception e) { throw new ProcessingException(LocalizationMessages.ERROR_WADL_BUILDER_GENERATION_REQUEST( resourceMethod, parentResource), e); } }
@Override public Request createRequest(AbstractResource r, AbstractResourceMethod m) { return new Request(); }
/** * Create the wadl {@link Representation} for the specified {@link MediaType} if not yet * existing for the wadl {@link Request} and return it. * @param r the resource * @param m the resource method * @param mediaType an accepted media type of the resource method * @param wadlRequest the wadl request the wadl representation is to be created for (if not yet existing). * @author Martin Grotzke * @return the wadl request representation for the specified {@link MediaType}. */ private Representation setRepresentationForMediaType(AbstractResource r, final AbstractResourceMethod m, MediaType mediaType, Request wadlRequest) { Representation wadlRepresentation = getRepresentationByMediaType(wadlRequest.getRepresentation(), mediaType); if (wadlRepresentation == null) { wadlRepresentation = _wadlGenerator.createRequestRepresentation(r, m, mediaType); wadlRequest.getRepresentation().add(wadlRepresentation); } return wadlRepresentation; }
wadlResourceParams.put(wadlParam.getName(), wadlParam); } else { wadlRequest.getParam().add(wadlParam);
private Request generateRequest(org.glassfish.jersey.server.model.Resource parentResource, final org.glassfish.jersey.server.model.ResourceMethod resourceMethod, Map<String, Param> wadlResourceParams) { try { final List<Parameter> requestParams = new LinkedList<>(resourceMethod.getInvocable().getParameters()); // Adding handler instance parameters to the list of potential request parameters. requestParams.addAll(resourceMethod.getInvocable().getHandler().getParameters()); if (requestParams.isEmpty()) { return null; } Request wadlRequest = _wadlGenerator.createRequest(parentResource, resourceMethod); processRequestParameters(parentResource, resourceMethod, wadlResourceParams, requestParams, wadlRequest); if (wadlRequest.getRepresentation().size() + wadlRequest.getParam().size() == 0) { return null; } else { return wadlRequest; } } catch (Exception e) { throw new ProcessingException(LocalizationMessages.ERROR_WADL_BUILDER_GENERATION_REQUEST( resourceMethod, parentResource), e); } }
/** * Create an instance of {@link Request } * */ public Request createRequest() { return new Request(); }