Package: grails.rest

## [Groovy] Annotation Type Resource

- grails.rest.Resource

- Meta Annotation to applied to a domain class if it is a REST resource

  Authors:
    Graeme Rocher
  Since:
    2.3

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `null` | `java.lang.String[]` | `formats()` @default "json", 'xml'] Returns: The allowed response formats
    `null` | `java.lang.String` | `namespace()` Returns: The namespace of the resource.
    `null` | `boolean` | `readOnly()` @default false Returns: Whether this is a read-only resource (one that doesn't allow DELETE, POST, PUT or PATCH requests)
    `null` | `java.lang.Class<?>` | `superClass()` @default RestfulController Returns: The super class to use for the generated controller class
    `null` | `java.lang.String` | `uri()` Returns: The URI of the resource.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Method Detail

    - #### java.lang.String[] formats()

      Default:
        "json", 'xml']
      Returns:
        The allowed response formats

    - #### java.lang.String namespace()

      Default:
        ""
      Returns:
        The namespace of the resource. If specified a UrlMapping with this namespace will automatically be registered for the resource

    - #### boolean readOnly()

      Default:
        false
      Returns:
        Whether this is a read-only resource (one that doesn't allow DELETE, POST, PUT or PATCH requests)

    - #### java.lang.Class<?> superClass()

      Default:
        RestfulController
      Returns:
        The super class to use for the generated controller class

    - #### java.lang.String uri()

      Default:
        ""
      Returns:
        The URI of the resource. If specified a UrlMapping will automatically be registered for the resource