public interface GroovyChain extends 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 Handler> handler) |
default GroovyChain |
all(Closure<?> handler)
Adds the given
Closure as a Handler to this GroovyChain. |
GroovyChain |
all(Handler handler) |
default Handler |
chain(Closure<?> closure)
Creates a handler from the given closure.
|
default GroovyChain |
delete(java.lang.Class<? extends 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(Handler handler) |
default GroovyChain |
delete(java.lang.String path,
java.lang.Class<? extends 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,
Handler handler) |
default GroovyChain |
files() |
default GroovyChain |
files(Action<? super FileHandlerSpec> config) |
default GroovyChain |
files(Closure<?> closure) |
default GroovyChain |
fileSystem(java.lang.String path,
Action<? super Chain> action) |
default GroovyChain |
fileSystem(java.lang.String path,
java.lang.Class<? extends Action<? super 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(Chain chain)
Creates a Groovy chain wrapper over a chain instance.
|
default GroovyChain |
get(java.lang.Class<? extends 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(Handler handler) |
default GroovyChain |
get(java.lang.String path,
java.lang.Class<? extends 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,
Handler handler) |
default GroovyChain |
host(java.lang.String hostName,
Action<? super Chain> action) |
default GroovyChain |
host(java.lang.String hostName,
java.lang.Class<? extends Action<? super 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(Action<? super Chain> action) |
default GroovyChain |
insert(java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
insert(Closure<?> closure)
Inserts the given nested handler chain.
|
default GroovyChain |
onlyIf(Closure<?> test,
Closure<?> handler) |
default GroovyChain |
onlyIf(Closure<?> test,
Handler handler) |
default GroovyChain |
onlyIf(Predicate<? super Context> test,
java.lang.Class<? extends Handler> handler) |
default GroovyChain |
onlyIf(Predicate<? super Context> test,
Closure<?> handler) |
default GroovyChain |
onlyIf(Predicate<? super Context> test,
Handler handler) |
default GroovyChain |
patch(java.lang.Class<? extends 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(Handler handler) |
default GroovyChain |
patch(java.lang.String path,
java.lang.Class<? extends 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,
Handler handler) |
default GroovyChain |
path(java.lang.Class<? extends Handler> handler) |
default GroovyChain |
path(Closure<?> handler) |
default GroovyChain |
path(Handler handler) |
default GroovyChain |
path(java.lang.String path,
java.lang.Class<? extends 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,
Handler handler) |
default GroovyChain |
post(java.lang.Class<? extends 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(Handler handler) |
default GroovyChain |
post(java.lang.String path,
java.lang.Class<? extends 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,
Handler handler) |
default GroovyChain |
prefix(java.lang.String prefix,
Action<? super Chain> action) |
default GroovyChain |
prefix(java.lang.String prefix,
java.lang.Class<? extends Action<? super 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 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(Handler handler) |
default GroovyChain |
put(java.lang.String path,
java.lang.Class<? extends 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,
Handler handler) |
default GroovyChain |
redirect(int code,
java.lang.String location) |
default GroovyChain |
register(Action<? super RegistrySpec> action) |
default GroovyChain |
register(Action<? super RegistrySpec> registryAction,
Action<? super Chain> chainAction) |
default GroovyChain |
register(Action<? super RegistrySpec> registryAction,
java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
register(Action<? super RegistrySpec> registryAction,
Closure<?> handler) |
default GroovyChain |
register(Closure<?> closure) |
default GroovyChain |
register(Registry registry) |
default GroovyChain |
register(Registry registry,
Action<? super Chain> action) |
default GroovyChain |
register(Registry registry,
java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
register(Registry registry,
Closure<?> handlers) |
default GroovyChain |
when(Closure<?> test,
Action<? super Chain> chain) |
default GroovyChain |
when(Closure<?> test,
Closure<?> handlers) |
default GroovyChain |
when(Predicate<? super Context> test,
Action<? super Chain> action) |
default GroovyChain |
when(Predicate<? super Context> test,
java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
when(Predicate<? super Context> test,
Closure<?> handlers) |
chain, chain, getRegistry, getServerConfigstatic GroovyChain from(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(Handler handler)
default GroovyChain all(java.lang.Class<? extends Handler> handler)
default 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, Handler handler)
default GroovyChain delete(java.lang.String path, java.lang.Class<? extends Handler> handler)
default GroovyChain delete(Handler handler)
default GroovyChain delete(java.lang.Class<? extends Handler> handler)
default 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, Action<? super Chain> action) throws java.lang.Exception
fileSystem in interface Chainjava.lang.Exceptiondefault GroovyChain fileSystem(java.lang.String path, java.lang.Class<? extends Action<? super Chain>> action) throws java.lang.Exception
fileSystem in interface Chainjava.lang.Exceptiondefault GroovyChain files(Action<? super FileHandlerSpec> config) throws java.lang.Exception
default GroovyChain files()
default 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, Handler handler)
default GroovyChain get(java.lang.String path, java.lang.Class<? extends Handler> handler)
default GroovyChain get(Handler handler)
default GroovyChain get(java.lang.Class<? extends Handler> handler)
default 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, Action<? super Chain> action) throws java.lang.Exception
default GroovyChain host(java.lang.String hostName, java.lang.Class<? extends Action<? super Chain>> action) throws java.lang.Exception
default 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(Action<? super Chain> action) throws java.lang.Exception
default GroovyChain insert(java.lang.Class<? extends Action<? super Chain>> action) throws java.lang.Exception
default 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, Handler handler)
default GroovyChain patch(java.lang.String path, java.lang.Class<? extends Handler> handler)
default GroovyChain patch(Handler handler)
default GroovyChain patch(java.lang.Class<? extends Handler> handler)
default 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 path(java.lang.String path, Handler handler)
default GroovyChain path(Handler handler)
default GroovyChain path(java.lang.String path, java.lang.Class<? extends Handler> handler)
default GroovyChain path(java.lang.Class<? extends Handler> handler)
default 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, Handler handler)
default GroovyChain post(java.lang.String path, java.lang.Class<? extends Handler> handler)
default GroovyChain post(Handler handler)
default GroovyChain post(java.lang.Class<? extends Handler> handler)
default 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, Action<? super Chain> action) throws java.lang.Exception
default GroovyChain prefix(java.lang.String prefix, java.lang.Class<? extends Action<? super Chain>> action) throws java.lang.Exception
default 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, Handler handler)
default GroovyChain put(java.lang.String path, java.lang.Class<? extends Handler> handler)
default GroovyChain put(Handler handler)
default GroovyChain put(java.lang.Class<? extends Handler> handler)
default 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)
default GroovyChain register(Registry registry)
default GroovyChain register(Action<? super RegistrySpec> action) throws java.lang.Exception
default GroovyChain register(Registry registry, Action<? super Chain> action) throws java.lang.Exception
default GroovyChain register(Registry registry, java.lang.Class<? extends Action<? super Chain>> action) throws java.lang.Exception
default GroovyChain register(Action<? super RegistrySpec> registryAction, Action<? super Chain> chainAction) throws java.lang.Exception
default GroovyChain register(Action<? super RegistrySpec> registryAction, java.lang.Class<? extends Action<? super Chain>> action) throws java.lang.Exception
default GroovyChain register(Action<? super RegistrySpec> registryAction, @DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> handler) throws java.lang.Exception
java.lang.Exceptiondefault GroovyChain register(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(Predicate<? super Context> test, Action<? super Chain> action) throws java.lang.Exception
default GroovyChain when(Predicate<? super Context> test, java.lang.Class<? extends Action<? super Chain>> action) throws java.lang.Exception
default GroovyChain when(Predicate<? super 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, Action<? super Chain> chain) throws java.lang.Exception
java.lang.Exceptiondefault GroovyChain onlyIf(Predicate<? super Context> test, Handler handler)
default GroovyChain onlyIf(Predicate<? super Context> test, java.lang.Class<? extends Handler> handler)
default GroovyChain onlyIf(Predicate<? super 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, Handler handler)