Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-28

if a class or super class is annotated, then ignore any interface's annotations

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • Beta4
    • Beta2
    • jaxrs
    • None

      I have attached some more code below. If the spec says that you either
      annotate the interface or the class/superclass that you can mentally
      remove the getSelf() defined in Device. It would move into the
      concrete implementation.

      interface Device {
      @GET
      Device getSelf();
      }

      @Path("devices")
      class RootResource {
      Device getDevice(String id)

      { // lookup and return a device, which is either Device1 or Device2 }

      }

      class Device1 implements Device {
      public Device getSelf()

      { return this; }

      @GET
      @Path("something")
      public Object getSomething() { // Get something }
      }

      class Device2 implements Device {
      public Device getSelf() { return this; }

      @GET
      @Path("else")
      public Object getSomethingElse()

      { // Get something else }

      }

            patriot1burke@gmail.com Bill Burke (Inactive)
            patriot1burke@gmail.com Bill Burke (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: