Package ratpack.handling
Interface ByMethodSpec
-
- All Known Subinterfaces:
GroovyByMethodSpec
public interface ByMethodSpecA specification of how to respond to a request, based on the requested method.- See Also:
Context.byMethod(ratpack.func.Action)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ByMethodSpecdelete(java.lang.Class<? extends Handler> clazz)Inserts the handler to chain if the request has a HTTP method of DELETE.ByMethodSpecdelete(Block block)Defines the action to to take if the request has a HTTP method of DELETE.ByMethodSpecdelete(Handler handler)Inserts the handler to chain if the request has a HTTP method of DELETE.ByMethodSpecget(java.lang.Class<? extends Handler> clazz)Inserts the handler to chain if the request has a HTTP method of GET.ByMethodSpecget(Block block)Defines the action to to take if the request has a HTTP method of GET.ByMethodSpecget(Handler handler)Inserts the handler to chain if the request has a HTTP method of GET.ByMethodSpecnamed(java.lang.String methodName, java.lang.Class<? extends Handler> clazz)Inserts the handler to chain if the request has a HTTP method ofmethodName.ByMethodSpecnamed(java.lang.String methodName, Block block)Defines the action to to take if the request has a HTTP method ofmethodName.ByMethodSpecnamed(java.lang.String methodName, Handler handler)Inserts the handler to chain if the request has a HTTP method ofmethodName.ByMethodSpecoptions(java.lang.Class<? extends Handler> clazz)Inserts the handler to chain if the request has a HTTP method of OPTIONS.ByMethodSpecoptions(Block block)Defines the action to to take if the request has a HTTP method of OPTIONS.ByMethodSpecoptions(Handler handler)Inserts the handler to chain if the request has a HTTP method of OPTIONS.ByMethodSpecpatch(java.lang.Class<? extends Handler> clazz)Inserts the handler to chain if the request has a HTTP method of PATCH.ByMethodSpecpatch(Block block)Defines the action to to take if the request has a HTTP method of PATCH.ByMethodSpecpatch(Handler handler)Inserts the handler to chain if the request has a HTTP method of PATCH.ByMethodSpecpost(java.lang.Class<? extends Handler> clazz)Inserts the handler to chain if the request has a HTTP method of POST.ByMethodSpecpost(Block block)Defines the action to to take if the request has a HTTP method of POST.ByMethodSpecpost(Handler handler)Inserts the handler to chain if the request has a HTTP method of POST.ByMethodSpecput(java.lang.Class<? extends Handler> clazz)Inserts the handler to chain if the request has a HTTP method of PUT.ByMethodSpecput(Block block)Defines the action to to take if the request has a HTTP method of PUT.ByMethodSpecput(Handler handler)Inserts the handler to chain if the request has a HTTP method of PUT.
-
-
-
Method Detail
-
get
ByMethodSpec get(Block block)
Defines the action to to take if the request has a HTTP method of GET.- Parameters:
block- the code to invoke if the request method matches- Returns:
- this
-
get
ByMethodSpec get(java.lang.Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method of GET.- Parameters:
clazz- a handler class- Returns:
- this
- Since:
- 1.5
-
get
ByMethodSpec get(Handler handler)
Inserts the handler to chain if the request has a HTTP method of GET.- Parameters:
handler- the handler to delegate to- Returns:
- this
- Since:
- 1.5
-
post
ByMethodSpec post(Block block)
Defines the action to to take if the request has a HTTP method of POST.- Parameters:
block- the code to invoke if the request method matches- Returns:
- this
-
post
ByMethodSpec post(java.lang.Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method of POST.- Parameters:
clazz- a handler class- Returns:
- this
- Since:
- 1.5
-
post
ByMethodSpec post(Handler handler)
Inserts the handler to chain if the request has a HTTP method of POST.- Parameters:
handler- the handler to delegate to- Returns:
- this
- Since:
- 1.5
-
put
ByMethodSpec put(Block block)
Defines the action to to take if the request has a HTTP method of PUT.- Parameters:
block- the code to invoke if the request method matches- Returns:
- this
-
put
ByMethodSpec put(java.lang.Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method of PUT.- Parameters:
clazz- a handler class- Returns:
- this
- Since:
- 1.5
-
put
ByMethodSpec put(Handler handler)
Inserts the handler to chain if the request has a HTTP method of PUT.- Parameters:
handler- the handler to delegate to- Returns:
- this
- Since:
- 1.5
-
patch
ByMethodSpec patch(Block block)
Defines the action to to take if the request has a HTTP method of PATCH.- Parameters:
block- the code to invoke if the request method matches- Returns:
- this
-
patch
ByMethodSpec patch(java.lang.Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method of PATCH.- Parameters:
clazz- a handler class- Returns:
- this
- Since:
- 1.5
-
patch
ByMethodSpec patch(Handler handler)
Inserts the handler to chain if the request has a HTTP method of PATCH.- Parameters:
handler- the handler to delegate to- Returns:
- this
- Since:
- 1.5
-
options
ByMethodSpec options(Block block)
Defines the action to to take if the request has a HTTP method of OPTIONS.- Parameters:
block- the code to invoke if the request method matches- Returns:
- this
- Since:
- 1.1
-
options
ByMethodSpec options(java.lang.Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method of OPTIONS.- Parameters:
clazz- a handler class- Returns:
- this
- Since:
- 1.5
-
options
ByMethodSpec options(Handler handler)
Inserts the handler to chain if the request has a HTTP method of OPTIONS.- Parameters:
handler- the handler to delegate to- Returns:
- this
- Since:
- 1.5
-
delete
ByMethodSpec delete(Block block)
Defines the action to to take if the request has a HTTP method of DELETE.- Parameters:
block- the code to invoke if the request method matches- Returns:
- this
-
delete
ByMethodSpec delete(java.lang.Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method of DELETE.- Parameters:
clazz- a handler class- Returns:
- this
- Since:
- 1.5
-
delete
ByMethodSpec delete(Handler handler)
Inserts the handler to chain if the request has a HTTP method of DELETE.- Parameters:
handler- the handler to delegate to- Returns:
- this
- Since:
- 1.5
-
named
ByMethodSpec named(java.lang.String methodName, Block block)
Defines the action to to take if the request has a HTTP method ofmethodName.The method name is case insensitive.
- Parameters:
methodName- The HTTP method to map the given action toblock- the code to invoke if the request method matches- Returns:
- this
-
named
ByMethodSpec named(java.lang.String methodName, java.lang.Class<? extends Handler> clazz)
Inserts the handler to chain if the request has a HTTP method ofmethodName.The method name is case insensitive.
- Parameters:
methodName- The HTTP method to map the given action toclazz- a handler class- Returns:
- this
- Since:
- 1.5
-
named
ByMethodSpec named(java.lang.String methodName, Handler handler)
Inserts the handler to chain if the request has a HTTP method ofmethodName.The method name is case insensitive.
- Parameters:
methodName- The HTTP method to map the given action tohandler- the handler to delegate to- Returns:
- this
- Since:
- 1.5
-
-