Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

## grails.rest
[Groovy] Annotation Type Resource

    java.lang.Object
      grails.rest.Resource

    @java.lang.annotation.Retention(RetentionPolicy.RUNTIME)
    @java.lang.annotation.Target([ElementType.TYPE])
    @org.codehaus.groovy.transform.GroovyASTTransformationClass("org.grails.plugins.web.rest.transform.ResourceTransform")
    @interface Resource

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

Authors:
  Graeme Rocher

Since:
  2.3

Method Summary
`java.lang.String[]` | `formats()` @default "xml", 'json'] Returns: The allowed response formats
`boolean` | `readOnly()` @default false Returns: Whether this is a read-only resource (one that doesn't allow DELETE, POST or PUT requests)
`java.lang.String` | `uri()` Returns: The URI of the resource.

Methods inherited from 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

### formats

    java.lang.String[] formats()

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

### readOnly

    boolean readOnly()

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

### uri

    java.lang.String uri()

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

Groovy Documentation