@Override public com.sun.research.ws.wadl.Method createMethod( org.glassfish.jersey.server.model.Resource r, final ResourceMethod m) { com.sun.research.ws.wadl.Method wadlMethod = new com.sun.research.ws.wadl.Method(); wadlMethod.setName(m.getHttpMethod()); wadlMethod.setId(m.getInvocable().getDefinitionMethod().getName()); if (m.isExtended()) { wadlMethod.getAny().add(WadlApplicationContextImpl.EXTENDED_ELEMENT); } return wadlMethod; }
@Override public com.sun.research.ws.wadl.Method createMethod( org.glassfish.jersey.server.model.Resource r, final ResourceMethod m) { com.sun.research.ws.wadl.Method wadlMethod = new com.sun.research.ws.wadl.Method(); wadlMethod.setName(m.getHttpMethod()); wadlMethod.setId(m.getInvocable().getDefinitionMethod().getName()); if (m.isExtended()) { wadlMethod.getAny().add(WadlApplicationContextImpl.EXTENDED_ELEMENT); } return wadlMethod; }
@Override public void visitResourceMethod(final ResourceMethod resourceMethod) { if (resourceMethod.isExtended()) { return; } if (resourceMethod.getInvocable() != null) { final Invocable i = resourceMethod.getInvocable(); Method method = i.getDefinitionMethod(); List<ProvideLinkDescriptor> linkDescriptors = new ArrayList<>(); handleMetaAnnotations(resourceMethod, method, linkDescriptors); handleAnnotations(resourceMethod, linkDescriptors, method, null); for (ProvideLinkDescriptor linkDescriptor : linkDescriptors) { for (Class<?> target : linkDescriptor.getProvideLink().value()) { target = handleInheritedTarget(linkDescriptor, target); newMappings.computeIfAbsent(target, aClass -> new ArrayList<>()).add(linkDescriptor); } } } processComponents(resourceMethod); }
private com.sun.research.ws.wadl.Method generateMethod( final org.glassfish.jersey.server.model.Resource parentResource, final Map<String, Param> wadlResourceParams, final org.glassfish.jersey.server.model.ResourceMethod resourceMethod) { try { if (!detailedWadl && resourceMethod.isExtended()) { return null; } com.sun.research.ws.wadl.Method wadlMethod = _wadlGenerator.createMethod(parentResource, resourceMethod); // generate the request part Request wadlRequest = generateRequest(parentResource, resourceMethod, wadlResourceParams); if (wadlRequest != null) { wadlMethod.setRequest(wadlRequest); } // generate the response part final List<Response> responses = generateResponses(parentResource, resourceMethod); if (responses != null) { wadlMethod.getResponse().addAll(responses); } return wadlMethod; } catch (Exception e) { throw new ProcessingException( LocalizationMessages.ERROR_WADL_BUILDER_GENERATION_METHOD(resourceMethod, parentResource), e); } }
private com.sun.research.ws.wadl.Method generateMethod( final org.glassfish.jersey.server.model.Resource parentResource, final Map<String, Param> wadlResourceParams, final org.glassfish.jersey.server.model.ResourceMethod resourceMethod) { try { if (!detailedWadl && resourceMethod.isExtended()) { return null; } com.sun.research.ws.wadl.Method wadlMethod = _wadlGenerator.createMethod(parentResource, resourceMethod); // generate the request part Request wadlRequest = generateRequest(parentResource, resourceMethod, wadlResourceParams); if (wadlRequest != null) { wadlMethod.setRequest(wadlRequest); } // generate the response part final List<Response> responses = generateResponses(parentResource, resourceMethod); if (responses != null) { wadlMethod.getResponse().addAll(responses); } return wadlMethod; } catch (Exception e) { throw new ProcessingException( LocalizationMessages.ERROR_WADL_BUILDER_GENERATION_METHOD(resourceMethod, parentResource), e); } }
return null; if (locator.isExtended()) { wadlSubResource.getAny().add(WadlApplicationContextImpl.EXTENDED_ELEMENT); if (!detailedWadl && method.isExtended()) { continue;
return null; if (locator.isExtended()) { wadlSubResource.getAny().add(WadlApplicationContextImpl.EXTENDED_ELEMENT); if (!detailedWadl && method.isExtended()) { continue;
/** * Create a builder from an existing resource method model. * * @param parent parent resource model builder. * @param originalMethod existing resource method model to create the builder from. */ /* package */ Builder(final Resource.Builder parent, ResourceMethod originalMethod) { this.parent = parent; this.consumedTypes = new LinkedHashSet<>(originalMethod.getConsumedTypes()); this.producedTypes = new LinkedHashSet<>(originalMethod.getProducedTypes()); this.suspended = originalMethod.isSuspendDeclared(); this.suspendTimeout = originalMethod.getSuspendTimeout(); this.suspendTimeoutUnit = originalMethod.getSuspendTimeoutUnit(); this.handlerParameters = new LinkedHashSet<>(originalMethod.getInvocable().getHandler().getParameters()); this.nameBindings = originalMethod.getNameBindings(); this.httpMethod = originalMethod.getHttpMethod(); this.managedAsync = originalMethod.isManagedAsyncDeclared(); Invocable invocable = originalMethod.getInvocable(); this.handlingMethod = invocable.getHandlingMethod(); this.encodedParams = false; this.routingResponseType = invocable.getRoutingResponseType(); this.extended = originalMethod.isExtended(); Method handlerMethod = invocable.getDefinitionMethod(); MethodHandler handler = invocable.getHandler(); if (handler.isClassBased()) { handledBy(handler.getHandlerClass(), handlerMethod); } else { handledBy(handler.getHandlerInstance(), handlerMethod); } }
@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); }
/** * Create a builder from an existing resource method model. * * @param parent parent resource model builder. * @param originalMethod existing resource method model to create the builder from. */ /* package */ Builder(final Resource.Builder parent, ResourceMethod originalMethod) { this.parent = parent; this.consumedTypes = new LinkedHashSet<>(originalMethod.getConsumedTypes()); this.producedTypes = new LinkedHashSet<>(originalMethod.getProducedTypes()); this.suspended = originalMethod.isSuspendDeclared(); this.suspendTimeout = originalMethod.getSuspendTimeout(); this.suspendTimeoutUnit = originalMethod.getSuspendTimeoutUnit(); this.handlerParameters = new LinkedHashSet<>(originalMethod.getInvocable().getHandler().getParameters()); this.nameBindings = originalMethod.getNameBindings(); this.httpMethod = originalMethod.getHttpMethod(); this.managedAsync = originalMethod.isManagedAsyncDeclared(); Invocable invocable = originalMethod.getInvocable(); this.handlingMethod = invocable.getHandlingMethod(); this.encodedParams = false; this.routingResponseType = invocable.getRoutingResponseType(); this.extended = originalMethod.isExtended(); Method handlerMethod = invocable.getDefinitionMethod(); MethodHandler handler = invocable.getHandler(); if (handler.isClassBased()) { handledBy(handler.getHandlerClass(), handlerMethod); } else { handledBy(handler.getHandlerInstance(), handlerMethod); } }
@Override public com.sun.research.ws.wadl.Method createMethod( org.glassfish.jersey.server.model.Resource r, final ResourceMethod m) { com.sun.research.ws.wadl.Method wadlMethod = new com.sun.research.ws.wadl.Method(); wadlMethod.setName(m.getHttpMethod()); wadlMethod.setId(m.getInvocable().getDefinitionMethod().getName()); if (m.isExtended()) { wadlMethod.getAny().add(WadlApplicationContextImpl.EXTENDED_ELEMENT); } return wadlMethod; }
private com.sun.research.ws.wadl.Method generateMethod( final org.glassfish.jersey.server.model.Resource parentResource, final Map<String, Param> wadlResourceParams, final org.glassfish.jersey.server.model.ResourceMethod resourceMethod) { try { if (!detailedWadl && resourceMethod.isExtended()) { return null; } com.sun.research.ws.wadl.Method wadlMethod = _wadlGenerator.createMethod(parentResource, resourceMethod); // generate the request part Request wadlRequest = generateRequest(parentResource, resourceMethod, wadlResourceParams); if (wadlRequest != null) { wadlMethod.setRequest(wadlRequest); } // generate the response part final List<Response> responses = generateResponses(parentResource, resourceMethod); if (responses != null) { wadlMethod.getResponse().addAll(responses); } return wadlMethod; } catch (Exception e) { throw new ProcessingException( LocalizationMessages.ERROR_WADL_BUILDER_GENERATION_METHOD(resourceMethod, parentResource), e); } }
return null; if (locator.isExtended()) { wadlSubResource.getAny().add(WadlApplicationContextImpl.EXTENDED_ELEMENT); if (!detailedWadl && method.isExtended()) { continue;
/** * Create a builder from an existing resource method model. * * @param parent parent resource model builder. * @param originalMethod existing resource method model to create the builder from. */ /* package */ Builder(final Resource.Builder parent, ResourceMethod originalMethod) { this.parent = parent; this.consumedTypes = new LinkedHashSet<>(originalMethod.getConsumedTypes()); this.producedTypes = new LinkedHashSet<>(originalMethod.getProducedTypes()); this.suspended = originalMethod.isSuspendDeclared(); this.suspendTimeout = originalMethod.getSuspendTimeout(); this.suspendTimeoutUnit = originalMethod.getSuspendTimeoutUnit(); this.handlerParameters = new LinkedHashSet<>(originalMethod.getInvocable().getHandler().getParameters()); this.nameBindings = originalMethod.getNameBindings(); this.httpMethod = originalMethod.getHttpMethod(); this.managedAsync = originalMethod.isManagedAsyncDeclared(); Invocable invocable = originalMethod.getInvocable(); this.handlingMethod = invocable.getHandlingMethod(); this.encodedParams = false; this.routingResponseType = invocable.getRoutingResponseType(); this.extended = originalMethod.isExtended(); Method handlerMethod = invocable.getDefinitionMethod(); MethodHandler handler = invocable.getHandler(); if (handler.isClassBased()) { handledBy(handler.getHandlerClass(), handlerMethod); } else { handledBy(handler.getHandlerInstance(), handlerMethod); } }
@Override public com.sun.research.ws.wadl.Method createMethod( org.glassfish.jersey.server.model.Resource r, final ResourceMethod m) { com.sun.research.ws.wadl.Method wadlMethod = new com.sun.research.ws.wadl.Method(); wadlMethod.setName(m.getHttpMethod()); wadlMethod.setId(m.getInvocable().getDefinitionMethod().getName()); if (m.isExtended()) { wadlMethod.getAny().add(WadlApplicationContextImpl.EXTENDED_ELEMENT); } return wadlMethod; }
@Override public com.sun.research.ws.wadl.Method createMethod( org.glassfish.jersey.server.model.Resource r, final ResourceMethod m) { com.sun.research.ws.wadl.Method wadlMethod = new com.sun.research.ws.wadl.Method(); wadlMethod.setName(m.getHttpMethod()); wadlMethod.setId(m.getInvocable().getDefinitionMethod().getName()); if (m.isExtended()) { wadlMethod.getAny().add(WadlApplicationContextImpl.EXTENDED_ELEMENT); } return wadlMethod; }
@Override public com.sun.research.ws.wadl.Method createMethod( org.glassfish.jersey.server.model.Resource r, final ResourceMethod m) { com.sun.research.ws.wadl.Method wadlMethod = new com.sun.research.ws.wadl.Method(); wadlMethod.setName(m.getHttpMethod()); wadlMethod.setId(m.getInvocable().getDefinitionMethod().getName()); if (m.isExtended()) { wadlMethod.getAny().add(WadlApplicationContextImpl.EXTENDED_ELEMENT); } return wadlMethod; }
@Override public com.sun.research.ws.wadl.Method createMethod( org.glassfish.jersey.server.model.Resource r, final ResourceMethod m) { com.sun.research.ws.wadl.Method wadlMethod = new com.sun.research.ws.wadl.Method(); wadlMethod.setName(m.getHttpMethod()); wadlMethod.setId(m.getInvocable().getDefinitionMethod().getName()); if (m.isExtended()) { wadlMethod.getAny().add(WadlApplicationContextImpl.EXTENDED_ELEMENT); } return wadlMethod; }
private com.sun.research.ws.wadl.Method generateMethod( final org.glassfish.jersey.server.model.Resource parentResource, final Map<String, Param> wadlResourceParams, final org.glassfish.jersey.server.model.ResourceMethod resourceMethod) { try { if (!detailedWadl && resourceMethod.isExtended()) { return null; } com.sun.research.ws.wadl.Method wadlMethod = _wadlGenerator.createMethod(parentResource, resourceMethod); // generate the request part Request wadlRequest = generateRequest(parentResource, resourceMethod, wadlResourceParams); if (wadlRequest != null) { wadlMethod.setRequest(wadlRequest); } // generate the response part final List<Response> responses = generateResponses(parentResource, resourceMethod); if (responses != null) { wadlMethod.getResponse().addAll(responses); } return wadlMethod; } catch (Exception e) { throw new ProcessingException( LocalizationMessages.ERROR_WADL_BUILDER_GENERATION_METHOD(resourceMethod, parentResource), e); } }
private com.sun.research.ws.wadl.Method generateMethod( final org.glassfish.jersey.server.model.Resource parentResource, final Map<String, Param> wadlResourceParams, final org.glassfish.jersey.server.model.ResourceMethod resourceMethod) { try { if (!detailedWadl && resourceMethod.isExtended()) { return null; } com.sun.research.ws.wadl.Method wadlMethod = _wadlGenerator.createMethod(parentResource, resourceMethod); // generate the request part Request wadlRequest = generateRequest(parentResource, resourceMethod, wadlResourceParams); if (wadlRequest != null) { wadlMethod.setRequest(wadlRequest); } // generate the response part final List<Response> responses = generateResponses(parentResource, resourceMethod); if (responses != null) { wadlMethod.getResponse().addAll(responses); } return wadlMethod; } catch (Exception e) { throw new ProcessingException( LocalizationMessages.ERROR_WADL_BUILDER_GENERATION_METHOD(resourceMethod, parentResource), e); } }