ControllersRestApi (Grails 2.3.8)
Date: 2014-04-24

Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD

## org.grails.plugins.web.rest.api
[Groovy] Class ControllersRestApi

    java.lang.Object
      org.grails.plugins.web.rest.api.ControllersRestApi

    @groovy.transform.CompileStatic
    class ControllersRestApi
    extends java.lang.Object

Provides the "respond" method in controllers

Authors:
  Graeme Rocher

Since:
  2.3

Field Summary
`static java.lang.String` | `PROPERTY_RESPONSE_FORMATS`
`protected ControllersApi` | `controllersApi`
`protected ControllersMimeTypesApi` | `mimeTypesApi`
`protected RendererRegistry` | `rendererRegistry`

Property Summary
`GroovyPageLocator` | `groovyPageLocator`
`ProxyHandler` | `proxyHandler`
`ResponseMimeTypesApi` | `responseMimeTypesApi`

Constructor Summary
`ControllersRestApi(RendererRegistry rendererRegistry, ControllersApi controllersApi, ControllersMimeTypesApi mimeTypesApi)`

Method Summary
`protected java.util.List` | `calculateFormats(java.lang.Object controller, java.lang.String actionName, java.lang.Object value, java.util.Map args)`
`protected java.util.List` | `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.

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

Field Detail

### PROPERTY_RESPONSE_FORMATS

    public static final java.lang.String PROPERTY_RESPONSE_FORMATS

### controllersApi

    @groovy.lang.Delegate
    protected ControllersApi controllersApi

### mimeTypesApi

    @groovy.lang.Delegate
    protected ControllersMimeTypesApi mimeTypesApi

### rendererRegistry

    protected RendererRegistry rendererRegistry

Property Detail

### groovyPageLocator

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

### proxyHandler

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

### responseMimeTypesApi

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

Constructor Detail

### ControllersRestApi

    ControllersRestApi(RendererRegistry rendererRegistry, ControllersApi controllersApi, ControllersMimeTypesApi mimeTypesApi)

Method Detail

### calculateFormats

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

### getDefaultResponseFormats

    protected java.util.List getDefaultResponseFormats(java.lang.Object value)

### getDomainErrors

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

### getResponseFormat

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

### respond

    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

### respond

    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:

Groovy Documentation