private List<MediaType> getEffectiveOutputTypes(final ResourceMethod resourceMethod) { if (!resourceMethod.getProducedTypes().isEmpty()) { return resourceMethod.getProducedTypes(); } List<MediaType> result = new LinkedList<>(); if (workers != null) { final Invocable invocable = resourceMethod.getInvocable(); result.addAll(workers.getMessageBodyWriterMediaTypes( invocable.getRawResponseType(), invocable.getResponseType(), invocable.getHandlingMethod().getAnnotations())); } return result.isEmpty() ? StarTypeList : result; }
private List<MediaType> getEffectiveOutputTypes(final ResourceMethod resourceMethod) { if (!resourceMethod.getProducedTypes().isEmpty()) { return resourceMethod.getProducedTypes(); } List<MediaType> result = new LinkedList<>(); if (workers != null) { final Invocable invocable = resourceMethod.getInvocable(); result.addAll(workers.getMessageBodyWriterMediaTypes( invocable.getRawResponseType(), invocable.getResponseType(), invocable.getHandlingMethod().getAnnotations())); } return result.isEmpty() ? StarTypeList : result; }
this.invocableResponseType = invocable.getResponseType(); this.canUseInvocableResponseType = invocableResponseType != null && Void.TYPE != invocableResponseType
/** * @param resource abstract resource * @param resourceMethod abstract resource method * @return response * @see org.glassfish.jersey.server.wadl.WadlGenerator#createResponses(org.glassfish.jersey.server.model.Resource, * org.glassfish.jersey.server.model.ResourceMethod) */ public List<Response> createResponses(final org.glassfish.jersey.server.model.Resource resource, final org.glassfish.jersey.server.model.ResourceMethod resourceMethod) { final List<Response> responses = wadlGeneratorDelegate.createResponses(resource, resourceMethod); if (responses != null) { for (final Response response : responses) { for (final Representation representation : response.getRepresentation()) { // Process each representation nameCallbacks.add(new TypeCallbackPair( new GenericType(resourceMethod.getInvocable().getResponseType()), new NameCallbackSetter() { public void setName(final QName name) { representation.setElement(name); } })); } } } return responses; }
this.invocableResponseType = invocable.getResponseType(); this.canUseInvocableResponseType = invocableResponseType != null && Void.TYPE != invocableResponseType
/** * @param resource abstract resource * @param resourceMethod abstract resource method * @return response * @see org.glassfish.jersey.server.wadl.WadlGenerator#createResponses(org.glassfish.jersey.server.model.Resource, * org.glassfish.jersey.server.model.ResourceMethod) */ public List<Response> createResponses(final org.glassfish.jersey.server.model.Resource resource, final org.glassfish.jersey.server.model.ResourceMethod resourceMethod) { final List<Response> responses = wadlGeneratorDelegate.createResponses(resource, resourceMethod); if (responses != null) { for (final Response response : responses) { for (final Representation representation : response.getRepresentation()) { // Process each representation nameCallbacks.add(new TypeCallbackPair( new GenericType(resourceMethod.getInvocable().getResponseType()), new NameCallbackSetter() { public void setName(final QName name) { representation.setElement(name); } })); } } } return responses; }
final Type responseType = invocable.getResponseType(); if (!isConcreteType(responseType)) { Errors.warning(invocable.getHandlingMethod(),
case SUB_RESOURCE_LOCATOR: final ResolvedType responseType = TYPE_RESOLVER .resolve(method.getInvocable().getResponseType()); final Class<?> erasedType = !responseType.getTypeBindings().isEmpty() ? responseType.getTypeBindings().getBoundType(0).getErasedType() :
final Type responseType = invocable.getResponseType(); if (!isConcreteType(responseType)) { Errors.warning(invocable.getHandlingMethod(),
@Override public void visitResourceMethod(final ResourceMethod resourceMethod) { if (resourceMethod.isExtended()) { return; } if (ResourceMethod.JaxrsType.SUB_RESOURCE_LOCATOR.equals(resourceMethod.getType())) { if (resourceMethod.getInvocable() != null) { final Invocable i = resourceMethod.getInvocable(); final Type type = i.getResponseType(); final StringBuilder template = getTemplate(); mappings.put((Class) type, getMapping(template)); // Process sub resources ? Resource.Builder builder = Resource .builder(i.getRawResponseType()); if (builder == null) { // for example in the case the return type of the sub resource locator is Object builder = Resource.builder().path(resourceMethod.getParent().getPath()); } final Resource subResource = builder.build(); visitChildResource(subResource); } } processComponents(resourceMethod); }
private List<MediaType> getEffectiveOutputTypes(final ResourceMethod resourceMethod) { if (!resourceMethod.getProducedTypes().isEmpty()) { return resourceMethod.getProducedTypes(); } List<MediaType> result = new LinkedList<>(); if (workers != null) { final Invocable invocable = resourceMethod.getInvocable(); result.addAll(workers.getMessageBodyWriterMediaTypes( invocable.getRawResponseType(), invocable.getResponseType(), invocable.getHandlingMethod().getAnnotations())); } return result.isEmpty() ? StarTypeList : result; }
this.invocableResponseType = invocable.getResponseType(); this.canUseInvocableResponseType = invocableResponseType != null && Void.TYPE != invocableResponseType
/** * @param resource abstract resource * @param resourceMethod abstract resource method * @return response * @see org.glassfish.jersey.server.wadl.WadlGenerator#createResponses(org.glassfish.jersey.server.model.Resource, * org.glassfish.jersey.server.model.ResourceMethod) */ public List<Response> createResponses(final org.glassfish.jersey.server.model.Resource resource, final org.glassfish.jersey.server.model.ResourceMethod resourceMethod) { final List<Response> responses = wadlGeneratorDelegate.createResponses(resource, resourceMethod); if (responses != null) { for (final Response response : responses) { for (final Representation representation : response.getRepresentation()) { // Process each representation nameCallbacks.add(new TypeCallbackPair( new GenericType(resourceMethod.getInvocable().getResponseType()), new NameCallbackSetter() { public void setName(final QName name) { representation.setElement(name); } })); } } } return responses; }
final Type responseType = invocable.getResponseType(); if (!isConcreteType(responseType)) { Errors.warning(invocable.getHandlingMethod(),
public static Optional<JaxRsEntity> getReturnValue(ResourceMethod resourceMethod, SourceParser sourceParser) { return JerseyJaxRsEntity.create(resourceMethod.getInvocable().getResponseType(), sourceParser); }
public static Optional<JaxRsEntity> getReturnValue(ResourceMethod resourceMethod, SourceParser sourceParser) { return JerseyJaxRsEntity.create(resourceMethod.getInvocable().getResponseType(), sourceParser); }
public static Optional<JaxRsEntity> getReturnValue(ResourceMethod resourceMethod, SourceParser sourceParser) { return JerseyJaxRsEntity.create(resourceMethod.getInvocable().getResponseType(), sourceParser); }
private List<MediaType> getEffectiveOutputTypes(final ResourceMethod resourceMethod) { if (!resourceMethod.getProducedTypes().isEmpty()) { return resourceMethod.getProducedTypes(); } List<MediaType> result = new LinkedList<>(); if (workers != null) { final Invocable invocable = resourceMethod.getInvocable(); result.addAll(workers.getMessageBodyWriterMediaTypes( invocable.getRawResponseType(), invocable.getResponseType(), invocable.getHandlingMethod().getAnnotations())); } return result.isEmpty() ? StarTypeList : result; }
private List<MediaType> getEffectiveOutputTypes(final ResourceMethod resourceMethod) { if (!resourceMethod.getProducedTypes().isEmpty()) { return resourceMethod.getProducedTypes(); } List<MediaType> result = new LinkedList<>(); if (workers != null) { final Invocable invocable = resourceMethod.getInvocable(); result.addAll(workers.getMessageBodyWriterMediaTypes( invocable.getRawResponseType(), invocable.getResponseType(), invocable.getHandlingMethod().getAnnotations())); } return result.isEmpty() ? StarTypeList : result; }
private List<MediaType> getEffectiveOutputTypes(final ResourceMethod resourceMethod) { if (!resourceMethod.getProducedTypes().isEmpty()) { return resourceMethod.getProducedTypes(); } List<MediaType> result = new LinkedList<>(); if (workers != null) { final Invocable invocable = resourceMethod.getInvocable(); result.addAll(workers.getMessageBodyWriterMediaTypes( invocable.getRawResponseType(), invocable.getResponseType(), invocable.getHandlingMethod().getAnnotations())); } return result.isEmpty() ? StarTypeList : result; }