@CompileStatic class RestfulControllerActions extends java.lang.Object
The shape of the actions RestfulController declares, used to describe a
controller reached through the default "/$controller/$action?/$id?" mapping rather than
through a mapping that names it.
| Type | Name and description |
|---|---|
static int |
DEFAULT_MAXThe default page size when none is asked for. |
static int |
MAX_RESULTSThe maximum a listing returns, whatever a larger max asks for. |
| Constructor and description |
|---|
RestfulControllerActions() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
static java.util.List<java.lang.String> |
allowedMethods(java.lang.String actionName, java.lang.Object allowedMethods)
|
|
static java.lang.String |
defaultMethod(java.lang.String actionName, boolean resourceController)The method an action a mapping does not restrict is described as answering: for a resource controller the one RestfulController's action answers, and otherwise GET. |
|
static boolean |
hasResponseBody(java.lang.String actionName)Whether the successful response carries the resource. |
|
static boolean |
isAction(java.lang.String actionName)Whether RestfulController declares an action of the name, which a resource controller answers by the part it plays in the resource: listing it, showing one, creating one, and so on. |
|
static boolean |
isCollection(java.lang.String actionName)Whether the action responds with a collection of the resource rather than one of them. |
|
static boolean |
isFormAction(java.lang.String actionName) |
|
static boolean |
locates(java.lang.Class<?> controllerClass, java.lang.String actionName)Whether the action answers with where the resource it created or updated is, in the Location header. |
|
static boolean |
paginates(java.lang.String actionName)Whether the action reads the paging and sorting parameters GORM binds from the query string. |
|
static boolean |
refusedWhenReadOnly(java.lang.Class<?> controllerClass, java.lang.String actionName)Whether a RestfulController constructed read only refuses the action. |
|
static java.lang.String |
successCode(java.lang.String actionName)The status a successful action responds with. |
|
static boolean |
takesId(java.lang.String actionName) |
|
static boolean |
validates(java.lang.String actionName)Whether the action validates what it binds, and so can answer with the validation errors. |
| 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 default page size when none is asked for.
The maximum a listing returns, whatever a larger max asks for.
actionName - the actionallowedMethods - the controller's declared allowedMethods, if anyallowedMethods lets the action answer, or null where it
declares none for the action, which then answers anyThe method an action a mapping does not restrict is described as answering: for a resource controller the one RestfulController's action answers, and otherwise GET.
Whether the successful response carries the resource. Delete renders no content.
Whether RestfulController declares an action of the name, which a resource controller answers by the part it plays in the resource: listing it, showing one, creating one, and so on.
Whether the action responds with a collection of the resource rather than one of them.
Whether the action answers with where the resource it created or updated is, in the
Location header. RestfulController's own save and update do, and its patch through
update. A controller generated for a REST application does not, so an action the controller
overrides, or declares itself, is not described with it.
Whether the action reads the paging and sorting parameters GORM binds from the query string. Only the listing does; the remaining actions address one resource.
Whether a RestfulController constructed read only refuses the action. RestfulController answers METHOD_NOT_ALLOWED from its write actions, so one the controller inherits is refused, while one it provides itself does whatever it provides.
The status a successful action responds with. RestfulController answers CREATED from save and NO_CONTENT from delete rather than OK.
Whether the action validates what it binds, and so can answer with the validation errors. Patch delegates to update, so all three do.