users@jersey.java.net

[Jersey] Restful interfaces and Jersey

From: Richard Kolb <rjdkolb_at_gmail.com>
Date: Mon, 26 May 2014 14:20:08 +0200

Hello

It is possible for Jersey to handle annotations on interfaces ?
i.e. Annotations on an interface and not on the implementation.

@Path("customers")
public interface CustomerService {
  @GET
  @Produces("application/json")
  public List<Customer> listAllCustomers();

--------------------------------------------------------------
public class CustomerServiceImpl implements CustomerService {
  @Override
  public List<Customer> listAllCustomers() {

--------------------------------------------------------------
@javax.ws.rs.ApplicationPath("webresources")
public class ApplicationConfig extends Application {
    private void addRestResourceClasses(Set<Class<?>> resources) {
        resources.add(discovery.gxtapp.shared.Customer.class);
        resources.add(discovery.gxtapp.server.CustomerServiceImpl.class);

thanks
Richard.