Package: org.grails.plugins.web.rest.api

## [Groovy] Class ControllersRestApi

- org.grails.plugins.web.rest.api.ControllersRestApi

- Provides the "respond" method in controllers

  Authors:
    Graeme Rocher
  Since:
    2.3

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static java.lang.String` | `PROPERTY_RESPONSE_FORMATS` |
    `protected ControllersApi` | `controllersApi` |
    `protected ControllersMimeTypesApi` | `mimeTypesApi` |
    `protected RendererRegistry` | `rendererRegistry` |

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `GroovyPageLocator` | `groovyPageLocator`
    `ProxyHandler` | `proxyHandler`
    `ResponseMimeTypesApi` | `responseMimeTypesApi`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `ControllersRestApi (RendererRegistry rendererRegistry, ControllersApi controllersApi, ControllersMimeTypesApi mimeTypesApi)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `protected java.util.List<java.lang.String>` | `calculateFormats(java.lang.Object controller, java.lang.String actionName, java.lang.Object value, java.util.Map args)`
    `protected java.util.List<java.lang.String>` | `getDefaultResponseFormats(java.lang.Object value)`
    `protected org.springframework.validation.Errors` | `getDomainErrors(java.lang.Object object)`
    `protected MimeType[]` | `getResponseFormat(javax.servlet.http.HttpServletResponse response)`
    `java.lang.Object` | `respond(java.lang.Object controller, java.util.Map args, java.lang.Object value)` Same as ControllersRestApi.respond, but here to support Groovy named arguments
    `java.lang.Object` | `respond(java.lang.Object controller, java.lang.Object value, java.util.Map args = [:])` The respond method will attempt to delivery an appropriate response for the requested response format and value.

  - ### 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()`

- - ### Field Detail

    - #### public static final java.lang.String PROPERTY_RESPONSE_FORMATS

    - #### @groovy.lang.Delegate protected ControllersApi controllersApi

    - #### @groovy.lang.Delegate protected ControllersMimeTypesApi mimeTypesApi

    - #### protected RendererRegistry rendererRegistry

  - ### Property Detail

    - #### @org.springframework.beans.factory.annotation.Autowired GroovyPageLocator groovyPageLocator

    - #### @org.springframework.beans.factory.annotation.Autowired(required = false) ProxyHandler proxyHandler

    - #### @org.springframework.beans.factory.annotation.Autowired ResponseMimeTypesApi responseMimeTypesApi

  - ### Constructor Detail

    - #### ControllersRestApi(RendererRegistry rendererRegistry, ControllersApi controllersApi, ControllersMimeTypesApi mimeTypesApi)

  - ### Method Detail

    - #### protected java.util.List<java.lang.String> calculateFormats(java.lang.Object controller, java.lang.String actionName, java.lang.Object value, java.util.Map args)

    - #### protected java.util.List<java.lang.String> getDefaultResponseFormats(java.lang.Object value)

    - #### @groovy.transform.CompileStatic(TypeCheckingMode.SKIP) protected org.springframework.validation.Errors getDomainErrors(java.lang.Object object)

    - #### protected MimeType[] getResponseFormat(javax.servlet.http.HttpServletResponse response)

    - #### java.lang.Object respond(java.lang.Object controller, java.util.Map args, java.lang.Object value)

      Same as ControllersRestApi.respond, but here to support Groovy named arguments

    - #### java.lang.Object respond(java.lang.Object controller, java.lang.Object value, java.util.Map args = [:])

      The respond method will attempt to delivery an appropriate response for the requested response format and value. If the value is null then a 404 will be returned. Otherwise the RendererRegistry will be consulted for an appropriate response renderer for the requested response format.

      Parameters:
        `controller` - The controller
        `value` - The value
        `args` - The arguments
      Returns: