@Override public ResourceMethodDispatcher create(final Invocable resourceMethod, final InvocationHandler handler, final ConfiguredValidator validator) { if (resourceMethod.getHandlingMethod().getReturnType() != void.class || !resourceMethod.getParameters().isEmpty()) { return null; } return resourceContext.initResource(new VoidToVoidDispatcher(resourceMethod, handler, validator)); } }
@Override public ResourceMethodDispatcher create(final Invocable resourceMethod, final InvocationHandler handler, final ConfiguredValidator validator) { if (resourceMethod.getHandlingMethod().getReturnType() != void.class || !resourceMethod.getParameters().isEmpty()) { return null; } return resourceContext.initResource(new VoidToVoidDispatcher(resourceMethod, handler, validator)); } }
/** * Create traversable resolver able to process {@link javax.validation.executable.ValidateOnExecution} annotation on * beans. * * @param delegate resolver to be wrapped into the custom traversable resolver. * @param handler handler to create traversable resolver for. * @return custom traversable resolver. */ private ValidateOnExecutionTraversableResolver getTraversableResolver(TraversableResolver delegate, final ValidateOnExecutionHandler handler) { if (delegate == null) { delegate = validationConfig.getDefaultTraversableResolver(); } final boolean validationEnabled = validationConfig.getBootstrapConfiguration().isExecutableValidationEnabled(); final ValidateOnExecutionTraversableResolver traversableResolver = new ValidateOnExecutionTraversableResolver(delegate, handler, validationEnabled); return resourceContext.initResource(traversableResolver); }
@Override public ResourceMethodDispatcher create(final Invocable resourceMethod, final InvocationHandler handler, final ConfiguredValidator validator) { if (resourceMethod.getHandlingMethod().getReturnType() != void.class || !resourceMethod.getParameters().isEmpty()) { return null; } return resourceContext.initResource(new VoidToVoidDispatcher(resourceMethod, handler, validator)); } }
@Path("{categoryId}/products") public CategoryProductResource getCategoryProducts( @PathParam("categoryId") int id, @Context ResourceContext rc) { return rc.initResource(new CategoryProductResource(id)); }
protected void initGenericResource(Object resource) { resourceContext.initResource(resource); }
public <T> T inject(T instance) { rc.initResource(instance); return BeanProvider.injectFields(instance); } }
@Override public <T> T initResource(final T t) { return get().initResource(t); } }
public EmployeeResource getEmployees(@PathParam("idCompany") String companyId) { EmployeeResource employeeResource = new EmployeeResource(companyId); return resourceContext.initResource(employeeResource);
@Path("") public Object start() throws Exception { Resource root = rootFactory.createRoot(); resourceContext.initResource(root); return root.init(); }
@Override public ResourceMethodDispatcher create(final Invocable resourceMethod, final InvocationHandler handler, final ConfiguredValidator validator) { if (resourceMethod.getHandlingMethod().getReturnType() != void.class || !resourceMethod.getParameters().isEmpty()) { return null; } return resourceContext.initResource(new VoidToVoidDispatcher(resourceMethod, handler, validator)); } }
@Override public ResourceMethodDispatcher create(final Invocable resourceMethod, final InvocationHandler handler, final ConfiguredValidator validator) { if (resourceMethod.getHandlingMethod().getReturnType() != void.class || !resourceMethod.getParameters().isEmpty()) { return null; } return resourceContext.initResource(new VoidToVoidDispatcher(resourceMethod, handler, validator)); } }
@Override public ResourceMethodDispatcher create(final Invocable resourceMethod, final InvocationHandler handler, final ConfiguredValidator validator) { if (resourceMethod.getHandlingMethod().getReturnType() != void.class || !resourceMethod.getParameters().isEmpty()) { return null; } return resourceContext.initResource(new VoidToVoidDispatcher(resourceMethod, handler, validator)); } }
@Path("/booksubresource/instance/context") public Book2 getBookSubResourceInstanceRC(@Context ResourceContext rc) { return rc.initResource(book2Sub); }
@Override public ResourceMethodDispatcher create(final Invocable resourceMethod, final InvocationHandler handler, final ConfiguredValidator validator) { if (resourceMethod.getHandlingMethod().getReturnType() != void.class || !resourceMethod.getParameters().isEmpty()) { return null; } return resourceContext.initResource(new VoidToVoidDispatcher(resourceMethod, handler, validator)); } }
@Path("nav") public ApplicationControllerSub getNavigationDrawer() { return resourceContext.initResource(new ApplicationControllerSub()); }
/** * Create traversable resolver able to process {@link javax.validation.executable.ValidateOnExecution} annotation on * beans. * * @param delegate resolver to be wrapped into the custom traversable resolver. * @param handler handler to create traversable resolver for. * @return custom traversable resolver. */ private ValidateOnExecutionTraversableResolver getTraversableResolver(TraversableResolver delegate, final ValidateOnExecutionHandler handler) { if (delegate == null) { delegate = validationConfig.getDefaultTraversableResolver(); } final boolean validationEnabled = validationConfig.getBootstrapConfiguration().isExecutableValidationEnabled(); final ValidateOnExecutionTraversableResolver traversableResolver = new ValidateOnExecutionTraversableResolver(delegate, handler, validationEnabled); return resourceContext.initResource(traversableResolver); }