@Override public void visitResourceMethod(final ResourceMethod method) { switch (method.getType()) { case RESOURCE_METHOD: visitJaxrsResourceMethod(method); break; case SUB_RESOURCE_LOCATOR: visitSubResourceLocator(method); break; } }
@Override public void visitResourceMethod(final ResourceMethod method) { switch (method.getType()) { case RESOURCE_METHOD: visitJaxrsResourceMethod(method); break; case SUB_RESOURCE_LOCATOR: visitSubResourceLocator(method); break; } }
@Override public Continuation apply(final RequestProcessingContext processingContext) { final RoutingContext rc = processingContext.routingContext(); switch (resourceMethod.getType()) { case RESOURCE_METHOD: case SUB_RESOURCE_METHOD: rc.setMatchedResourceMethod(resourceMethod); break; case SUB_RESOURCE_LOCATOR: rc.pushMatchedLocator(resourceMethod); break; } return Continuation.of(processingContext); } }
@Override public Continuation apply(final RequestProcessingContext processingContext) { final RoutingContext rc = processingContext.routingContext(); switch (resourceMethod.getType()) { case RESOURCE_METHOD: case SUB_RESOURCE_METHOD: rc.setMatchedResourceMethod(resourceMethod); break; case SUB_RESOURCE_LOCATOR: rc.pushMatchedLocator(resourceMethod); break; } return Continuation.of(processingContext); } }
private Router createMethodRouter(final ResourceMethod resourceMethod) { Router methodAcceptor = null; switch (resourceMethod.getType()) { case RESOURCE_METHOD: case SUB_RESOURCE_METHOD: methodAcceptor = Routers.endpoint(createInflector(resourceMethod)); break; case SUB_RESOURCE_LOCATOR: methodAcceptor = locatorBuilder.get().getRouter(resourceMethod); break; } return new PushMethodHandlerRouter(resourceMethod.getInvocable().getHandler(), methodAcceptor); }
private Router createMethodRouter(final ResourceMethod resourceMethod) { Router methodAcceptor = null; switch (resourceMethod.getType()) { case RESOURCE_METHOD: case SUB_RESOURCE_METHOD: methodAcceptor = Routers.endpoint(createInflector(resourceMethod)); break; case SUB_RESOURCE_LOCATOR: methodAcceptor = locatorBuilder.get().getRouter(resourceMethod); break; } return new PushMethodHandlerRouter(resourceMethod.getInvocable().getHandler(), methodAcceptor); }
private void checkParameters(ResourceMethod method) { final Invocable invocable = method.getInvocable(); final Method handlingMethod = invocable.getHandlingMethod(); int paramCount = 0; int nonAnnotatedParameters = 0; for (Parameter p : invocable.getParameters()) { validateParameter(p, handlingMethod, handlingMethod.toGenericString(), Integer.toString(++paramCount), false); if (method.getType() == ResourceMethod.JaxrsType.SUB_RESOURCE_LOCATOR && Parameter.Source.ENTITY == p.getSource()) { Errors.fatal(method, LocalizationMessages.SUBRES_LOC_HAS_ENTITY_PARAM(invocable.getHandlingMethod())); } else if (p.getAnnotations().length == 0) { nonAnnotatedParameters++; if (nonAnnotatedParameters > 1) { Errors.fatal(method, LocalizationMessages.AMBIGUOUS_NON_ANNOTATED_PARAMETER(invocable.getHandlingMethod(), invocable.getHandlingMethod().getDeclaringClass())); } } } }
private void checkParameters(ResourceMethod method) { final Invocable invocable = method.getInvocable(); final Method handlingMethod = invocable.getHandlingMethod(); int paramCount = 0; int nonAnnotatedParameters = 0; for (Parameter p : invocable.getParameters()) { validateParameter(p, handlingMethod, handlingMethod.toGenericString(), Integer.toString(++paramCount), false); if (method.getType() == ResourceMethod.JaxrsType.SUB_RESOURCE_LOCATOR && Parameter.Source.ENTITY == p.getSource()) { Errors.fatal(method, LocalizationMessages.SUBRES_LOC_HAS_ENTITY_PARAM(invocable.getHandlingMethod())); } else if (p.getAnnotations().length == 0) { nonAnnotatedParameters++; if (nonAnnotatedParameters > 1) { Errors.fatal(method, LocalizationMessages.AMBIGUOUS_NON_ANNOTATED_PARAMETER(invocable.getHandlingMethod(), invocable.getHandlingMethod().getDeclaringClass())); } } } }
switch (method.getType()) { case RESOURCE_METHOD: methodLines.add(new EndpointLogLine(method.getHttpMethod(), path, handler));
@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); }
@Override public void visitResourceMethod(final ResourceMethod method) { switch (method.getType()) { case RESOURCE_METHOD: visitJaxrsResourceMethod(method); break; case SUB_RESOURCE_LOCATOR: visitSubResourceLocator(method); break; } }
@Override public Continuation apply(final RequestProcessingContext processingContext) { final RoutingContext rc = processingContext.routingContext(); switch (resourceMethod.getType()) { case RESOURCE_METHOD: case SUB_RESOURCE_METHOD: rc.setMatchedResourceMethod(resourceMethod); break; case SUB_RESOURCE_LOCATOR: rc.pushMatchedLocator(resourceMethod); break; } return Continuation.of(processingContext); } }
private void checkParameters(ResourceMethod method) { final Invocable invocable = method.getInvocable(); final Method handlingMethod = invocable.getHandlingMethod(); int paramCount = 0; int nonAnnotatedParameters = 0; for (Parameter p : invocable.getParameters()) { validateParameter(p, handlingMethod, handlingMethod.toGenericString(), Integer.toString(++paramCount), false); if (method.getType() == ResourceMethod.JaxrsType.SUB_RESOURCE_LOCATOR && Parameter.Source.ENTITY == p.getSource()) { Errors.fatal(method, LocalizationMessages.SUBRES_LOC_HAS_ENTITY_PARAM(invocable.getHandlingMethod())); } else if (p.getAnnotations().length == 0) { nonAnnotatedParameters++; if (nonAnnotatedParameters > 1) { Errors.fatal(method, LocalizationMessages.AMBIGUOUS_NON_ANNOTATED_PARAMETER(invocable.getHandlingMethod(), invocable.getHandlingMethod().getDeclaringClass())); } } } }
private Router createMethodRouter(final ResourceMethod resourceMethod) { Router methodAcceptor = null; switch (resourceMethod.getType()) { case RESOURCE_METHOD: case SUB_RESOURCE_METHOD: methodAcceptor = Routers.endpoint(createInflector(resourceMethod)); break; case SUB_RESOURCE_LOCATOR: methodAcceptor = locatorBuilder.get().getRouter(resourceMethod); break; } return new PushMethodHandlerRouter(resourceMethod.getInvocable().getHandler(), methodAcceptor); }
@Override public void visitResourceMethod(final ResourceMethod method) { switch (method.getType()) { case RESOURCE_METHOD: visitJaxrsResourceMethod(method); break; case SUB_RESOURCE_LOCATOR: visitSubResourceLocator(method); break; } }
@Override public void visitResourceMethod(final ResourceMethod method) { switch (method.getType()) { case RESOURCE_METHOD: visitJaxrsResourceMethod(method); break; case SUB_RESOURCE_LOCATOR: visitSubResourceLocator(method); break; } }
@Override public void visitResourceMethod(final ResourceMethod method) { switch (method.getType()) { case RESOURCE_METHOD: visitJaxrsResourceMethod(method); break; case SUB_RESOURCE_LOCATOR: visitSubResourceLocator(method); break; } }
@Override public void visitResourceMethod(final ResourceMethod method) { switch (method.getType()) { case RESOURCE_METHOD: visitJaxrsResourceMethod(method); break; case SUB_RESOURCE_LOCATOR: visitSubResourceLocator(method); break; } }
private Router createMethodRouter(final ResourceMethod resourceMethod) { Router methodAcceptor = null; switch (resourceMethod.getType()) { case RESOURCE_METHOD: case SUB_RESOURCE_METHOD: methodAcceptor = Routers.endpoint(createInflector(resourceMethod)); break; case SUB_RESOURCE_LOCATOR: methodAcceptor = locatorBuilder.get().getRouter(resourceMethod); break; } return new PushMethodHandlerRouter(resourceMethod.getInvocable().getHandler(), methodAcceptor); }
private Router createMethodRouter(final ResourceMethod resourceMethod) { Router methodAcceptor = null; switch (resourceMethod.getType()) { case RESOURCE_METHOD: case SUB_RESOURCE_METHOD: methodAcceptor = Routers.endpoint(createInflector(resourceMethod)); break; case SUB_RESOURCE_LOCATOR: methodAcceptor = locatorBuilder.get().getRouter(resourceMethod); break; } return new PushMethodHandlerRouter(resourceMethod.getInvocable().getHandler(), methodAcceptor); }