public interface GroovyChain
extends ratpack.handling.Chain
The methods specific to this subclass create Handler instances from closures and
add them to the underlying chain.
These methods are generally shortcuts for all(ratpack.handling.Handler) on this underlying chain.
| Modifier and Type | Method and Description |
|---|---|
default GroovyChain |
all(java.lang.Class<? extends ratpack.handling.Handler> handler) |
default GroovyChain |
all(Closure<?> handler)
Adds the given
Closure as a Handler to this GroovyChain. |
GroovyChain |
all(ratpack.handling.Handler handler) |
default ratpack.handling.Handler |
chain(Closure<?> closure)
Creates a handler from the given closure.
|
default GroovyChain |
delete(java.lang.Class<? extends ratpack.handling.Handler> handler) |
default GroovyChain |
delete(Closure<?> handler)
Adds a
Handler to this GroovyChain that delegates to the given Closure as a Handler
if the request HTTPMethod is DELETE and the path is at the current root. |
default GroovyChain |
delete(ratpack.handling.Handler handler) |
default GroovyChain |
delete(java.lang.String path,
java.lang.Class<? extends ratpack.handling.Handler> handler) |
default GroovyChain |
delete(java.lang.String path,
Closure<?> handler)
Adds a
Handler to this GroovyChain that delegates to the given Closure as a Handler if the
relative path matches the given path and the request HTTPMethod is DELETE. |
default GroovyChain |
delete(java.lang.String path,
ratpack.handling.Handler handler) |
default GroovyChain |
files() |
default GroovyChain |
files(ratpack.func.Action<? super ratpack.file.FileHandlerSpec> config) |
default GroovyChain |
files(Closure<?> closure) |
default GroovyChain |
fileSystem(java.lang.String path,
ratpack.func.Action<? super ratpack.handling.Chain> action) |
default GroovyChain |
fileSystem(java.lang.String path,
java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> action) |
default GroovyChain |
fileSystem(java.lang.String path,
Closure<?> handlers)
Creates a
List of Handler from the given Closure and adds a Handler to this GroovyChain that
changes the FileSystemBinding for the Handler list. |
static GroovyChain |
from(ratpack.handling.Chain chain)
Creates a Groovy chain wrapper over a chain instance.
|
default GroovyChain |
get(java.lang.Class<? extends ratpack.handling.Handler> handler) |
default GroovyChain |
get(Closure<?> handler)
Adds a
Handler to this GroovyChain that delegates to the given Closure as a Handler
if the request HTTPMethod is GET and the path is at the current root. |
default GroovyChain |
get(ratpack.handling.Handler handler) |
default GroovyChain |
get(java.lang.String path,
java.lang.Class<? extends ratpack.handling.Handler> handler) |
default GroovyChain |
get(java.lang.String path,
Closure<?> handler)
Adds a
Handler to this GroovyChain that delegates to the given Closure as a Handler if the
relative path matches the given path and the request HTTPMethod is GET. |
default GroovyChain |
get(java.lang.String path,
ratpack.handling.Handler handler) |
default GroovyChain |
host(java.lang.String hostName,
ratpack.func.Action<? super ratpack.handling.Chain> action) |
default GroovyChain |
host(java.lang.String hostName,
java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> action) |
default GroovyChain |
host(java.lang.String hostName,
Closure<?> handler)
If the request has a
Host header that matches the given host name exactly, handling will be delegated to the chain defined by the given closure. |
default GroovyChain |
insert(ratpack.func.Action<? super ratpack.handling.Chain> action) |
default GroovyChain |
insert(java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> action) |
default GroovyChain |
insert(Closure<?> closure)
Inserts the given nested handler chain.
|
default GroovyChain |
notFound() |
default GroovyChain |
onlyIf(Closure<?> test,
java.lang.Class<? extends ratpack.handling.Handler> handler) |
default GroovyChain |
onlyIf(Closure<?> test,
Closure<?> handler) |
default GroovyChain |
onlyIf(Closure<?> test,
ratpack.handling.Handler handler) |
default GroovyChain |
onlyIf(ratpack.func.Predicate<? super ratpack.handling.Context> test,
java.lang.Class<? extends ratpack.handling.Handler> handler) |
default GroovyChain |
onlyIf(ratpack.func.Predicate<? super ratpack.handling.Context> test,
Closure<?> handler) |
default GroovyChain |
onlyIf(ratpack.func.Predicate<? super ratpack.handling.Context> test,
ratpack.handling.Handler handler) |
default GroovyChain |
options(java.lang.Class<? extends ratpack.handling.Handler> handler) |
default GroovyChain |
options(Closure<?> handler)
Adds a
Handler to this GroovyChain that delegates to the given Closure as a Handler
if the request HTTPMethod is OPTIONS and the path is at the current root. |
default GroovyChain |
options(ratpack.handling.Handler handler) |
default GroovyChain |
options(java.lang.String path,
java.lang.Class<? extends ratpack.handling.Handler> handler) |
default GroovyChain |
options(java.lang.String path,
Closure<?> handler)
Adds a
Handler to this GroovyChain that delegates to the given Closure as a Handler if the
relative path matches the given path and the request HTTPMethod is OPTIONS. |
default GroovyChain |
options(java.lang.String path,
ratpack.handling.Handler handler) |
default GroovyChain |
patch(java.lang.Class<? extends ratpack.handling.Handler> handler) |
default GroovyChain |
patch(Closure<?> handler)
Adds a
Handler to this GroovyChain that delegates to the given Closure as a Handler
if the request HTTPMethod is PATCH and the path is at the current root. |
default GroovyChain |
patch(ratpack.handling.Handler handler) |
default GroovyChain |
patch(java.lang.String path,
java.lang.Class<? extends ratpack.handling.Handler> handler) |
default GroovyChain |
patch(java.lang.String path,
Closure<?> handler)
Adds a
Handler to this GroovyChain that delegates to the given Closure as a Handler if the
relative path matches the given path and the request HTTPMethod is PATCH. |
default GroovyChain |
patch(java.lang.String path,
ratpack.handling.Handler handler) |
default GroovyChain |
path(java.lang.Class<? extends ratpack.handling.Handler> handler) |
default GroovyChain |
path(Closure<?> handler) |
default GroovyChain |
path(ratpack.handling.Handler handler) |
default GroovyChain |
path(java.lang.String path,
java.lang.Class<? extends ratpack.handling.Handler> handler) |
default GroovyChain |
path(java.lang.String path,
Closure<?> handler)
Adds a
Handler to this GroovyChain that delegates to the given Closure as a Handler if the
relative path matches the given path exactly. |
default GroovyChain |
path(java.lang.String path,
ratpack.handling.Handler handler) |
default GroovyChain |
post(java.lang.Class<? extends ratpack.handling.Handler> handler) |
default GroovyChain |
post(Closure<?> handler)
Adds a
Handler to this GroovyChain that delegates to the given Closure as a Handler
if the request HTTPMethod is POST and the path is at the current root. |
default GroovyChain |
post(ratpack.handling.Handler handler) |
default GroovyChain |
post(java.lang.String path,
java.lang.Class<? extends ratpack.handling.Handler> handler) |
default GroovyChain |
post(java.lang.String path,
Closure<?> handler)
Adds a
Handler to this GroovyChain that delegates to the given Closure as a Handler if the
relative path matches the given path and the request HTTPMethod is POST. |
default GroovyChain |
post(java.lang.String path,
ratpack.handling.Handler handler) |
default GroovyChain |
prefix(java.lang.String prefix,
ratpack.func.Action<? super ratpack.handling.Chain> action) |
default GroovyChain |
prefix(java.lang.String prefix,
java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> action) |
default GroovyChain |
prefix(java.lang.String prefix,
Closure<?> chain)
Creates a
List of Handler from the given Closure and adds a Handler to
this GroovyChain that delegates to the Handler list if the relative path starts with the given
prefix. |
default GroovyChain |
put(java.lang.Class<? extends ratpack.handling.Handler> handler) |
default GroovyChain |
put(Closure<?> handler)
Adds a
Handler to this GroovyChain that delegates to the given Closure as a Handler
if the request HTTPMethod is PUT and the path is at the current root. |
default GroovyChain |
put(ratpack.handling.Handler handler) |
default GroovyChain |
put(java.lang.String path,
java.lang.Class<? extends ratpack.handling.Handler> handler) |
default GroovyChain |
put(java.lang.String path,
Closure<?> handler)
Adds a
Handler to this GroovyChain that delegates to the given Closure as a Handler if the
relative path matches the given path and the request HTTPMethod is PUT. |
default GroovyChain |
put(java.lang.String path,
ratpack.handling.Handler handler) |
default GroovyChain |
redirect(int code,
java.lang.String location) |
default GroovyChain |
register(ratpack.func.Action<? super ratpack.registry.RegistrySpec> action) |
default GroovyChain |
register(ratpack.func.Action<? super ratpack.registry.RegistrySpec> registryAction,
ratpack.func.Action<? super ratpack.handling.Chain> chainAction) |
default GroovyChain |
register(ratpack.func.Action<? super ratpack.registry.RegistrySpec> registryAction,
java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> action) |
default GroovyChain |
register(ratpack.func.Action<? super ratpack.registry.RegistrySpec> registryAction,
Closure<?> handler) |
default GroovyChain |
register(Closure<?> closure) |
default GroovyChain |
register(ratpack.registry.Registry registry) |
default GroovyChain |
register(ratpack.registry.Registry registry,
ratpack.func.Action<? super ratpack.handling.Chain> action) |
default GroovyChain |
register(ratpack.registry.Registry registry,
java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> action) |
default GroovyChain |
register(ratpack.registry.Registry registry,
Closure<?> handlers) |
default GroovyChain |
when(boolean test,
ratpack.func.Action<? super ratpack.handling.Chain> action) |
default GroovyChain |
when(boolean test,
ratpack.func.Action<? super ratpack.handling.Chain> onTrue,
ratpack.func.Action<? super ratpack.handling.Chain> onFalse) |
default GroovyChain |
when(boolean test,
java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> action) |
default GroovyChain |
when(boolean test,
java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> onTrue,
java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> onFalse) |
default GroovyChain |
when(boolean test,
Closure<?> handlers)
Inlines the given handlers if
test is true. |
default GroovyChain |
when(boolean test,
Closure<?> ifHandlers,
Closure<?> elseHandlers)
Inlines the appropriate handlers based on the given
test. |
default GroovyChain |
when(Closure<?> test,
ratpack.func.Action<? super ratpack.handling.Chain> chain) |
default GroovyChain |
when(Closure<?> test,
ratpack.func.Action<? super ratpack.handling.Chain> ifChain,
ratpack.func.Action<? super ratpack.handling.Chain> elseChain) |
default GroovyChain |
when(Closure<?> test,
java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> action) |
default GroovyChain |
when(Closure<?> test,
java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> ifAction,
java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> elseAction) |
default GroovyChain |
when(Closure<?> test,
Closure<?> handlers) |
default GroovyChain |
when(Closure<?> test,
Closure<?> ifHandlers,
Closure<?> elseHandlers) |
default GroovyChain |
when(ratpack.func.Predicate<? super ratpack.handling.Context> test,
ratpack.func.Action<? super ratpack.handling.Chain> action) |
default GroovyChain |
when(ratpack.func.Predicate<? super ratpack.handling.Context> test,
ratpack.func.Action<? super ratpack.handling.Chain> onTrue,
ratpack.func.Action<? super ratpack.handling.Chain> onFalse) |
default GroovyChain |
when(ratpack.func.Predicate<? super ratpack.handling.Context> test,
java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> action) |
default GroovyChain |
when(ratpack.func.Predicate<? super ratpack.handling.Context> test,
java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> onTrue,
java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> onFalse) |
default GroovyChain |
when(ratpack.func.Predicate<? super ratpack.handling.Context> test,
Closure<?> handlers) |
default GroovyChain |
when(ratpack.func.Predicate<? super ratpack.handling.Context> test,
Closure<?> ifHandlers,
Closure<?> elseHandlers) |
static GroovyChain from(ratpack.handling.Chain chain)
chain - a chain instancedefault GroovyChain all(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Closure as a Handler to this GroovyChain.handler - the Closure to addGroovyChainGroovyChain all(ratpack.handling.Handler handler)
all in interface ratpack.handling.Chaindefault GroovyChain all(java.lang.Class<? extends ratpack.handling.Handler> handler)
all in interface ratpack.handling.Chaindefault ratpack.handling.Handler chain(@DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> closure) throws java.lang.Exception
closure - a chain definitionjava.lang.Exception - any thrown by closuredefault GroovyChain delete(java.lang.String path, @DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Handler to this GroovyChain that delegates to the given Closure as a Handler if the
relative path matches the given path and the request HTTPMethod is DELETE.
See delete(String, ratpack.handling.Handler) for more details.
path - the relative path to match onhandler - the handler to delegate toGroovyChaindefault GroovyChain delete(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Handler to this GroovyChain that delegates to the given Closure as a Handler
if the request HTTPMethod is DELETE and the path is at the current root.
See delete(ratpack.handling.Handler) for more details.
handler - the handler to delegate toGroovyChaindefault GroovyChain delete(java.lang.String path, ratpack.handling.Handler handler)
delete in interface ratpack.handling.Chaindefault GroovyChain delete(java.lang.String path, java.lang.Class<? extends ratpack.handling.Handler> handler)
delete in interface ratpack.handling.Chaindefault GroovyChain delete(ratpack.handling.Handler handler)
delete in interface ratpack.handling.Chaindefault GroovyChain delete(java.lang.Class<? extends ratpack.handling.Handler> handler)
delete in interface ratpack.handling.Chaindefault GroovyChain fileSystem(java.lang.String path, @DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> handlers) throws java.lang.Exception
List of Handler from the given Closure and adds a Handler to this GroovyChain that
changes the FileSystemBinding for the Handler list.
See fileSystem(String, ratpack.func.Action) for more details.
path - the relative path to the new file system binding pointhandlers - the definition of the handler chainGroovyChainjava.lang.Exception - any thrown by closuredefault GroovyChain fileSystem(java.lang.String path, ratpack.func.Action<? super ratpack.handling.Chain> action) throws java.lang.Exception
fileSystem in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain fileSystem(java.lang.String path, java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> action) throws java.lang.Exception
fileSystem in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain files(ratpack.func.Action<? super ratpack.file.FileHandlerSpec> config) throws java.lang.Exception
files in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain files()
files in interface ratpack.handling.Chaindefault GroovyChain files(@DelegatesTo(value=ratpack.file.FileHandlerSpec.class,strategy=1) Closure<?> closure) throws java.lang.Exception
java.lang.Exceptiondefault GroovyChain get(java.lang.String path, ratpack.handling.Handler handler)
get in interface ratpack.handling.Chaindefault GroovyChain get(java.lang.String path, java.lang.Class<? extends ratpack.handling.Handler> handler)
get in interface ratpack.handling.Chaindefault GroovyChain get(ratpack.handling.Handler handler)
get in interface ratpack.handling.Chaindefault GroovyChain get(java.lang.Class<? extends ratpack.handling.Handler> handler)
get in interface ratpack.handling.Chaindefault GroovyChain get(java.lang.String path, @DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Handler to this GroovyChain that delegates to the given Closure as a Handler if the
relative path matches the given path and the request HTTPMethod is GET.
See get(String, ratpack.handling.Handler) for more details.
path - the relative path to match onhandler - the handler to delegate toGroovyChaindefault GroovyChain get(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Handler to this GroovyChain that delegates to the given Closure as a Handler
if the request HTTPMethod is GET and the path is at the current root.
See get(ratpack.handling.Handler) for more details.
handler - the handler to delegate toGroovyChaindefault GroovyChain host(java.lang.String hostName, ratpack.func.Action<? super ratpack.handling.Chain> action) throws java.lang.Exception
host in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain host(java.lang.String hostName, java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> action) throws java.lang.Exception
host in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain host(java.lang.String hostName, @DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> handler) throws java.lang.Exception
Host header that matches the given host name exactly, handling will be delegated to the chain defined by the given closure.hostName - the name of the HTTP Header to match onhandler - the handler to delegate toGroovyChainjava.lang.Exception - any thrown by closurehost(String, ratpack.func.Action)default GroovyChain insert(ratpack.func.Action<? super ratpack.handling.Chain> action) throws java.lang.Exception
insert in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain insert(java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> action) throws java.lang.Exception
insert in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain insert(@DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> closure) throws java.lang.Exception
Shorter form of all(Handler) handler}(chain(closure).
closure - the handler chain to insertjava.lang.Exception - any thrown by closuredefault GroovyChain patch(java.lang.String path, ratpack.handling.Handler handler)
patch in interface ratpack.handling.Chaindefault GroovyChain patch(java.lang.String path, java.lang.Class<? extends ratpack.handling.Handler> handler)
patch in interface ratpack.handling.Chaindefault GroovyChain patch(ratpack.handling.Handler handler)
patch in interface ratpack.handling.Chaindefault GroovyChain patch(java.lang.Class<? extends ratpack.handling.Handler> handler)
patch in interface ratpack.handling.Chaindefault GroovyChain patch(java.lang.String path, @DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Handler to this GroovyChain that delegates to the given Closure as a Handler if the
relative path matches the given path and the request HTTPMethod is PATCH.
See put(String, ratpack.handling.Handler) for more details.
path - the relative path to match onhandler - the handler to delegate toGroovyChaindefault GroovyChain patch(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Handler to this GroovyChain that delegates to the given Closure as a Handler
if the request HTTPMethod is PATCH and the path is at the current root.
See put(ratpack.handling.Handler) for more details.
handler - the handler to delegate toGroovyChaindefault GroovyChain options(java.lang.String path, ratpack.handling.Handler handler)
options in interface ratpack.handling.Chaindefault GroovyChain options(java.lang.String path, java.lang.Class<? extends ratpack.handling.Handler> handler)
options in interface ratpack.handling.Chaindefault GroovyChain options(ratpack.handling.Handler handler)
options in interface ratpack.handling.Chaindefault GroovyChain options(java.lang.Class<? extends ratpack.handling.Handler> handler)
options in interface ratpack.handling.Chaindefault GroovyChain options(java.lang.String path, @DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Handler to this GroovyChain that delegates to the given Closure as a Handler if the
relative path matches the given path and the request HTTPMethod is OPTIONS.
See put(String, ratpack.handling.Handler) for more details.
path - the relative path to match onhandler - the handler to delegate toGroovyChaindefault GroovyChain options(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Handler to this GroovyChain that delegates to the given Closure as a Handler
if the request HTTPMethod is OPTIONS and the path is at the current root.
See put(ratpack.handling.Handler) for more details.
handler - the handler to delegate toGroovyChaindefault GroovyChain path(java.lang.String path, ratpack.handling.Handler handler)
path in interface ratpack.handling.Chaindefault GroovyChain path(ratpack.handling.Handler handler)
path in interface ratpack.handling.Chaindefault GroovyChain path(java.lang.String path, java.lang.Class<? extends ratpack.handling.Handler> handler)
path in interface ratpack.handling.Chaindefault GroovyChain path(java.lang.Class<? extends ratpack.handling.Handler> handler)
path in interface ratpack.handling.Chaindefault GroovyChain path(java.lang.String path, @DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Handler to this GroovyChain that delegates to the given Closure as a Handler if the
relative path matches the given path exactly.
See path(String, ratpack.handling.Handler) for more details.
path - the relative path to match exactly onhandler - the handler to delegate toGroovyChaindefault GroovyChain path(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
default GroovyChain post(java.lang.String path, ratpack.handling.Handler handler)
post in interface ratpack.handling.Chaindefault GroovyChain post(java.lang.String path, java.lang.Class<? extends ratpack.handling.Handler> handler)
post in interface ratpack.handling.Chaindefault GroovyChain post(ratpack.handling.Handler handler)
post in interface ratpack.handling.Chaindefault GroovyChain post(java.lang.Class<? extends ratpack.handling.Handler> handler)
post in interface ratpack.handling.Chaindefault GroovyChain post(java.lang.String path, @DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Handler to this GroovyChain that delegates to the given Closure as a Handler if the
relative path matches the given path and the request HTTPMethod is POST.
See post(String, ratpack.handling.Handler) for more details.
path - the relative path to match onhandler - the handler to delegate toGroovyChaindefault GroovyChain post(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Handler to this GroovyChain that delegates to the given Closure as a Handler
if the request HTTPMethod is POST and the path is at the current root.
See post(ratpack.handling.Handler) for more details.
handler - the handler to delegate toGroovyChaindefault GroovyChain prefix(java.lang.String prefix, ratpack.func.Action<? super ratpack.handling.Chain> action) throws java.lang.Exception
prefix in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain prefix(java.lang.String prefix, java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> action) throws java.lang.Exception
prefix in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain prefix(java.lang.String prefix, @DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> chain) throws java.lang.Exception
List of Handler from the given Closure and adds a Handler to
this GroovyChain that delegates to the Handler list if the relative path starts with the given
prefix.
See Chain.prefix(String, ratpack.func.Action) for more details.
prefix - the relative path to match onchain - the definition of the chain to delegate toGroovyChainjava.lang.Exception - any exception thrown by the given closuredefault GroovyChain put(java.lang.String path, ratpack.handling.Handler handler)
put in interface ratpack.handling.Chaindefault GroovyChain put(java.lang.String path, java.lang.Class<? extends ratpack.handling.Handler> handler)
put in interface ratpack.handling.Chaindefault GroovyChain put(ratpack.handling.Handler handler)
put in interface ratpack.handling.Chaindefault GroovyChain put(java.lang.Class<? extends ratpack.handling.Handler> handler)
put in interface ratpack.handling.Chaindefault GroovyChain put(java.lang.String path, @DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Handler to this GroovyChain that delegates to the given Closure as a Handler if the
relative path matches the given path and the request HTTPMethod is PUT.
See put(String, ratpack.handling.Handler) for more details.
path - the relative path to match onhandler - the handler to delegate toGroovyChaindefault GroovyChain put(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Handler to this GroovyChain that delegates to the given Closure as a Handler
if the request HTTPMethod is PUT and the path is at the current root.
See put(ratpack.handling.Handler) for more details.
handler - the handler to delegate toGroovyChaindefault GroovyChain redirect(int code, java.lang.String location)
redirect in interface ratpack.handling.Chaindefault GroovyChain register(ratpack.registry.Registry registry)
register in interface ratpack.handling.Chaindefault GroovyChain register(ratpack.func.Action<? super ratpack.registry.RegistrySpec> action) throws java.lang.Exception
register in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain register(ratpack.registry.Registry registry, ratpack.func.Action<? super ratpack.handling.Chain> action) throws java.lang.Exception
register in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain register(ratpack.registry.Registry registry, java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> action) throws java.lang.Exception
register in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain register(ratpack.func.Action<? super ratpack.registry.RegistrySpec> registryAction, ratpack.func.Action<? super ratpack.handling.Chain> chainAction) throws java.lang.Exception
register in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain register(ratpack.func.Action<? super ratpack.registry.RegistrySpec> registryAction, java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> action) throws java.lang.Exception
register in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain register(ratpack.func.Action<? super ratpack.registry.RegistrySpec> registryAction, @DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> handler) throws java.lang.Exception
java.lang.Exceptiondefault GroovyChain register(ratpack.registry.Registry registry, @DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> handlers) throws java.lang.Exception
java.lang.Exceptiondefault GroovyChain register(@DelegatesTo(value=ratpack.registry.RegistrySpec.class,strategy=1) Closure<?> closure) throws java.lang.Exception
java.lang.Exceptiondefault GroovyChain when(ratpack.func.Predicate<? super ratpack.handling.Context> test, ratpack.func.Action<? super ratpack.handling.Chain> action) throws java.lang.Exception
when in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain when(ratpack.func.Predicate<? super ratpack.handling.Context> test, java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> action) throws java.lang.Exception
when in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain when(ratpack.func.Predicate<? super ratpack.handling.Context> test, @DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> handlers) throws java.lang.Exception
java.lang.Exceptiondefault GroovyChain when(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> test, @DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> handlers) throws java.lang.Exception
java.lang.Exceptiondefault GroovyChain when(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> test, ratpack.func.Action<? super ratpack.handling.Chain> chain) throws java.lang.Exception
java.lang.Exceptiondefault GroovyChain when(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> test, java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> action) throws java.lang.Exception
java.lang.Exceptiondefault GroovyChain when(boolean test, @DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> handlers) throws java.lang.Exception
test is true.
This is literally just sugar for wrapping the given action in an if statement.
It can be useful when conditionally adding handlers based on state available when building the chain.
test - whether to include the given chain actionhandlers - the handlers to maybe includejava.lang.Exception - any thrown by actionChain.when(boolean, Action)default GroovyChain when(boolean test, ratpack.func.Action<? super ratpack.handling.Chain> action) throws java.lang.Exception
when in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain when(boolean test, java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> action) throws java.lang.Exception
when in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain when(ratpack.func.Predicate<? super ratpack.handling.Context> test, ratpack.func.Action<? super ratpack.handling.Chain> onTrue, ratpack.func.Action<? super ratpack.handling.Chain> onFalse) throws java.lang.Exception
when in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain when(ratpack.func.Predicate<? super ratpack.handling.Context> test, java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> onTrue, java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> onFalse) throws java.lang.Exception
when in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain when(ratpack.func.Predicate<? super ratpack.handling.Context> test, @DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> ifHandlers, @DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> elseHandlers) throws java.lang.Exception
java.lang.Exceptiondefault GroovyChain when(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> test, @DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> ifHandlers, @DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> elseHandlers) throws java.lang.Exception
java.lang.Exceptiondefault GroovyChain when(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> test, ratpack.func.Action<? super ratpack.handling.Chain> ifChain, ratpack.func.Action<? super ratpack.handling.Chain> elseChain) throws java.lang.Exception
java.lang.Exceptiondefault GroovyChain when(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> test, java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> ifAction, java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> elseAction) throws java.lang.Exception
java.lang.Exceptiondefault GroovyChain when(boolean test, @DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> ifHandlers, @DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> elseHandlers) throws java.lang.Exception
test.
A value of true will result in the given ifHandlers being used.
A value of false will result in the given elseHandlers being used.
This is literally just sugar for wrapping the given action in an if/else statement. It can be useful when conditionally adding handlers based on state available when building the chain.
test - predicate to decide which handlers to includeifHandlers - the handlers to include when the test is trueelseHandlers - the handlers to include when the test is falsejava.lang.Exception - any thrown by actionChain.when(boolean, Action, Action)default GroovyChain when(boolean test, ratpack.func.Action<? super ratpack.handling.Chain> onTrue, ratpack.func.Action<? super ratpack.handling.Chain> onFalse) throws java.lang.Exception
when in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain when(boolean test, java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> onTrue, java.lang.Class<? extends ratpack.func.Action<? super ratpack.handling.Chain>> onFalse) throws java.lang.Exception
when in interface ratpack.handling.Chainjava.lang.Exceptiondefault GroovyChain onlyIf(ratpack.func.Predicate<? super ratpack.handling.Context> test, ratpack.handling.Handler handler)
onlyIf in interface ratpack.handling.Chaindefault GroovyChain onlyIf(ratpack.func.Predicate<? super ratpack.handling.Context> test, java.lang.Class<? extends ratpack.handling.Handler> handler)
onlyIf in interface ratpack.handling.Chaindefault GroovyChain onlyIf(ratpack.func.Predicate<? super ratpack.handling.Context> test, @DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
default GroovyChain onlyIf(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> test, @DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
default GroovyChain onlyIf(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> test, ratpack.handling.Handler handler)
default GroovyChain onlyIf(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> test, java.lang.Class<? extends ratpack.handling.Handler> handler)
default GroovyChain notFound()
notFound in interface ratpack.handling.Chain