Package | Description |
---|---|
ratpack.groovy.handling |
Groovy specific extensions to classes in the
ratpack.handling package. |
Modifier and Type | Class and Description |
---|---|
class |
GroovyChainAction
A convenience super class for a standalone implementation of a
Action<GroovyChain> . |
Modifier and Type | Method and Description |
---|---|
default GroovyChain |
GroovyChain.all(Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.all(Closure<?> handler)
Adds the given
Closure as a Handler to this GroovyChain . |
GroovyChain |
GroovyChain.all(Handler handler)
Adds the given handler to this.
|
GroovyChain |
GroovyChainAction.all(Handler handler)
Adds the given handler to this.
|
default GroovyChain |
GroovyChain.delete(Class<? extends Handler> handler) |
default GroovyChain |
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 |
GroovyChain.delete(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is DELETE and the path is at the current root. |
default GroovyChain |
GroovyChain.delete(String path,
Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.delete(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 |
GroovyChain.delete(String path,
Handler handler)
Adds a handler that delegates to the given handler if
the relative
path matches the given path and the request HTTPMethod
is DELETE . |
default GroovyChain |
GroovyChain.files() |
default GroovyChain |
GroovyChain.files(Action<? super FileHandlerSpec> config)
Adds a handler that serves files from the file system.
|
default GroovyChain |
GroovyChain.files(Closure<?> closure) |
default GroovyChain |
GroovyChain.fileSystem(String path,
Action<? super Chain> action)
Adds a handler to this chain that changes the
FileSystemBinding for the given handler chain. |
default GroovyChain |
GroovyChain.fileSystem(String path,
Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.fileSystem(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 |
GroovyChain.from(Chain chain)
Creates a Groovy chain wrapper over a chain instance.
|
default GroovyChain |
GroovyChain.get(Class<? extends Handler> handler) |
default GroovyChain |
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 |
GroovyChain.get(Handler handler)
Adds a handler that delegates to the given handler
if the
request HTTPMethod is GET and the path is at the
current root. |
default GroovyChain |
GroovyChain.get(String path,
Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.get(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 |
GroovyChain.get(String path,
Handler handler)
Adds a handler that delegates to the given handler
if the relative
path matches the given path and the request
HTTPMethod is GET . |
default GroovyChain |
GroovyChain.host(String hostName,
Action<? super Chain> action)
Adds a handler to the chain that delegates to the given handler chain if the request has a
Host header that matches the given value exactly. |
default GroovyChain |
GroovyChain.host(String hostName,
Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.host(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 |
GroovyChain.insert(Action<? super Chain> action)
Inserts the given nested handler chain.
|
default GroovyChain |
GroovyChain.insert(Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.insert(Closure<?> closure)
Inserts the given nested handler chain.
|
default GroovyChain |
GroovyChain.notFound()
Raises a 404
Context.clientError(int) . |
default GroovyChain |
GroovyChain.onlyIf(Closure<?> test,
Closure<?> handler) |
default GroovyChain |
GroovyChain.onlyIf(Closure<?> test,
Handler handler) |
default GroovyChain |
GroovyChain.onlyIf(Predicate<? super Context> test,
Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.onlyIf(Predicate<? super Context> test,
Closure<?> handler) |
default GroovyChain |
GroovyChain.onlyIf(Predicate<? super Context> test,
Handler handler) |
default GroovyChain |
GroovyChain.options(Class<? extends Handler> handler) |
default GroovyChain |
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 |
GroovyChain.options(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is OPTIONS and the path is at the current root. |
default GroovyChain |
GroovyChain.options(String path,
Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.options(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 |
GroovyChain.options(String path,
Handler handler)
Adds a handler that delegates to the given handler if
the relative
path matches the given path and the request HTTPMethod
is OPTIONS . |
default GroovyChain |
GroovyChain.patch(Class<? extends Handler> handler) |
default GroovyChain |
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 |
GroovyChain.patch(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is PATCH and the path is at the current root. |
default GroovyChain |
GroovyChain.patch(String path,
Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.patch(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 |
GroovyChain.patch(String path,
Handler handler)
Adds a handler that delegates to the given handler if
the relative
path matches the given path and the request HTTPMethod
is PATCH . |
default GroovyChain |
GroovyChain.path(Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.path(Closure<?> handler) |
default GroovyChain |
GroovyChain.path(Handler handler) |
default GroovyChain |
GroovyChain.path(String path,
Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.path(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 |
GroovyChain.path(String path,
Handler handler)
Adds a handler that delegates to the given handler if the relative
path
matches the given path exactly. |
default GroovyChain |
GroovyChain.post(Class<? extends Handler> handler) |
default GroovyChain |
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 |
GroovyChain.post(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is POST and the path is at the current root. |
default GroovyChain |
GroovyChain.post(String path,
Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.post(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 |
GroovyChain.post(String path,
Handler handler)
Adds a handler that delegates to the given handler if
the relative
path matches the given path and the request HTTPMethod
is POST . |
default GroovyChain |
GroovyChain.prefix(String prefix,
Action<? super Chain> action)
Adds a handler that delegates to the given handlers if the
relative path starts with the given
prefix . |
default GroovyChain |
GroovyChain.prefix(String prefix,
Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.prefix(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 |
GroovyChain.put(Class<? extends Handler> handler) |
default GroovyChain |
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 |
GroovyChain.put(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is PUT and the path is at the current root. |
default GroovyChain |
GroovyChain.put(String path,
Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.put(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 |
GroovyChain.put(String path,
Handler handler)
Adds a handler that delegates to the given handler if
the relative
path matches the given path and the request HTTPMethod
is PUT . |
default GroovyChain |
GroovyChain.redirect(int code,
String location)
Sends an HTTP redirect to the specified location.
|
default GroovyChain |
GroovyChain.register(Action<? super RegistrySpec> action)
Builds a new registry via the given action, then registers it via
Chain.register(Registry) . |
default GroovyChain |
GroovyChain.register(Action<? super RegistrySpec> registryAction,
Action<? super Chain> chainAction)
Adds a handler that inserts the given handler chain with a registry built by the given action via
Context.insert(ratpack.registry.Registry, Handler...) . |
default GroovyChain |
GroovyChain.register(Action<? super RegistrySpec> registryAction,
Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.register(Action<? super RegistrySpec> registryAction,
Closure<?> handler) |
default GroovyChain |
GroovyChain.register(Closure<?> closure) |
default GroovyChain |
GroovyChain.register(Registry registry)
Makes the contents of the given registry available for downstream handlers of the same nesting level.
|
default GroovyChain |
GroovyChain.register(Registry registry,
Action<? super Chain> action)
Adds a handler that inserts the given handler chain with the given registry via
Context.insert(ratpack.registry.Registry, Handler...) . |
default GroovyChain |
GroovyChain.register(Registry registry,
Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.register(Registry registry,
Closure<?> handlers) |
default GroovyChain |
GroovyChain.when(Closure<?> test,
Action<? super Chain> chain) |
default GroovyChain |
GroovyChain.when(Closure<?> test,
Closure<?> handlers) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
Action<? super Chain> action) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
Closure<?> handlers) |