@CompileStatic class ControllerCatalog extends java.lang.Object
The controllers of an application, as a description reads them: by the name and namespace a mapping reaches them by, and by what they serve.
| Constructor and description |
|---|
ControllerCatalog(GrailsApplication grailsApplication) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
java.lang.Object |
allowedMethods(GrailsControllerClass controller)The HTTP methods a controller allows, by action. |
|
GrailsControllerClass |
controllerFor(java.lang.String name, java.lang.String namespace)The controller a mapping dispatches to. |
|
java.util.Collection<GrailsControllerClass> |
getControllers()
|
|
java.lang.Object |
instance(GrailsControllerClass controller)The controller the application context serves requests with, if it holds one. |
|
boolean |
isReadOnly(GrailsControllerClass controller)Whether a RestfulController was constructed read only, which is decided by its constructor rather than declared on the class, so is read from the controller itself. |
|
boolean |
isResourceAction(GrailsControllerClass controller, java.lang.String actionName)Whether an action is described by the part it plays in the resource its controller serves: it is one RestfulController declares, of a resource controller, whether the controller inherits it, overrides it, or, as a controller generated for a REST application does, declares it itself. |
|
boolean |
isResourceController(GrailsControllerClass controller)Whether a controller serves a resource the way a RestfulController does: it is one, or its save and update actions bind the same domain class, as the controllers the rest-api profile generates do. |
|
boolean |
isRestAction(GrailsControllerClass controller, java.lang.String actionName)An action a mapping reaching controllers by name describes: one of a RestfulController, or one its controller declares the formats of, none of them HTML. |
|
boolean |
isRestController(GrailsControllerClass controller)A controller a mapping reaching controllers by name describes an action of: a RestfulController, or one declaring the formats an action responds in, as a REST controller does, none of them HTML, rather than one rendering views for a browser. |
|
java.lang.Class<?> |
resourceType(GrailsControllerClass controller)The type a resource controller serves: the type argument a RestfulController declares, or the resource it was constructed with, or the domain class a generated controller binds. |
|
java.util.List<java.lang.String> |
responseFormats(GrailsControllerClass controller, java.lang.String actionName)The formats an action responds in, read as respond reads them: a list declared for
every action, or the list a map declares for the action. |
|
boolean |
takesId(GrailsControllerClass controller, java.lang.String actionName)Whether an action addresses one resource, and so takes the identifier a mapping may leave optional: the resource actions that address one, or an action declaring an id
parameter. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
The HTTP methods a controller allows, by action.
The controller a mapping dispatches to. A mapping that names a namespace reaches that namespace's controller; one that names none reaches the controller without a namespace, or the only controller of that name.
The controller the application context serves requests with, if it holds one.
Whether a RestfulController was constructed read only, which is decided by its constructor rather than declared on the class, so is read from the controller itself.
Whether an action is described by the part it plays in the resource its controller serves: it is one RestfulController declares, of a resource controller, whether the controller inherits it, overrides it, or, as a controller generated for a REST application does, declares it itself. A generated controller answers such an action with the statuses, bodies and paging RestfulController does. Any other action is described as any controller's is.
Whether a controller serves a resource the way a RestfulController does: it is one, or its save and update actions bind the same domain class, as the controllers the rest-api profile generates do.
An action a mapping reaching controllers by name describes: one of a RestfulController, or
one its controller declares the formats of, none of them HTML. Where responseFormats is
a map, each action is decided by its own entry.
A controller a mapping reaching controllers by name describes an action of: a RestfulController, or one declaring the formats an action responds in, as a REST controller does, none of them HTML, rather than one rendering views for a browser.
The type a resource controller serves: the type argument a RestfulController declares, or the resource it was constructed with, or the domain class a generated controller binds.
The formats an action responds in, read as respond reads them: a list declared for
every action, or the list a map declares for the action.
Whether an action addresses one resource, and so takes the identifier a mapping may leave
optional: the resource actions that address one, or an action declaring an id
parameter.