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(java.lang.Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.all(Closure<?> handler)
Adds the given
Closure as a Handler to this GroovyChain . |
GroovyChain |
GroovyChainAction.all(Handler handler)
Adds the given handler to this.
|
GroovyChain |
GroovyChain.all(Handler handler)
Adds the given handler to this.
|
default GroovyChain |
GroovyChain.delete(java.lang.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(java.lang.String path,
java.lang.Class<? extends Handler> handler) |
default GroovyChain |
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 |
GroovyChain.delete(java.lang.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(java.lang.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(java.lang.String path,
java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
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 |
GroovyChain.from(Chain chain)
Creates a Groovy chain wrapper over a chain instance.
|
default GroovyChain |
GroovyChain.get(java.lang.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(java.lang.String path,
java.lang.Class<? extends Handler> handler) |
default GroovyChain |
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 |
GroovyChain.get(java.lang.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(java.lang.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(java.lang.String hostName,
java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
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 |
GroovyChain.insert(Action<? super Chain> action)
Inserts the given nested handler chain.
|
default GroovyChain |
GroovyChain.insert(java.lang.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,
java.lang.Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.onlyIf(Closure<?> test,
Closure<?> handler) |
default GroovyChain |
GroovyChain.onlyIf(Closure<?> test,
Handler handler) |
default GroovyChain |
GroovyChain.onlyIf(Predicate<? super Context> test,
java.lang.Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.onlyIf(Predicate<? super Context> test,
Closure<?> handler) |
default GroovyChain |
GroovyChain.onlyIf(Predicate<? super Context> test,
Handler handler)
Invokes the given handler only if the predicate passes.
|
default GroovyChain |
GroovyChain.options(java.lang.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(java.lang.String path,
java.lang.Class<? extends Handler> handler) |
default GroovyChain |
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 |
GroovyChain.options(java.lang.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(java.lang.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(java.lang.String path,
java.lang.Class<? extends Handler> handler) |
default GroovyChain |
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 |
GroovyChain.patch(java.lang.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(java.lang.Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.path(Closure<?> handler) |
default GroovyChain |
GroovyChain.path(Handler handler) |
default GroovyChain |
GroovyChain.path(java.lang.String path,
java.lang.Class<? extends Handler> handler) |
default GroovyChain |
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 |
GroovyChain.path(java.lang.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(java.lang.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(java.lang.String path,
java.lang.Class<? extends Handler> handler) |
default GroovyChain |
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 |
GroovyChain.post(java.lang.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(java.lang.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(java.lang.String prefix,
java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
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 |
GroovyChain.put(java.lang.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(java.lang.String path,
java.lang.Class<? extends Handler> handler) |
default GroovyChain |
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 |
GroovyChain.put(java.lang.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,
java.lang.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,
java.lang.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,
java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.register(Registry registry,
Closure<?> handlers) |
default GroovyChain |
GroovyChain.when(boolean test,
Action<? super Chain> action)
Inlines the given chain if
test is true . |
default GroovyChain |
GroovyChain.when(boolean test,
Action<? super Chain> onTrue,
Action<? super Chain> onFalse)
Inlines the appropriate chain based on the given
test . |
default GroovyChain |
GroovyChain.when(boolean test,
java.lang.Class<? extends Action<? super Chain>> action)
Inlines the given chain if
test is true . |
default GroovyChain |
GroovyChain.when(boolean test,
java.lang.Class<? extends Action<? super Chain>> onTrue,
java.lang.Class<? extends Action<? super Chain>> onFalse)
Inlines the appropriate chain based on the given
test . |
default GroovyChain |
GroovyChain.when(boolean test,
Closure<?> handlers)
Inlines the given handlers if
test is true . |
default GroovyChain |
GroovyChain.when(boolean test,
Closure<?> ifHandlers,
Closure<?> elseHandlers)
Inlines the appropriate handlers based on the given
test . |
default GroovyChain |
GroovyChain.when(Closure<?> test,
Action<? super Chain> chain) |
default GroovyChain |
GroovyChain.when(Closure<?> test,
Action<? super Chain> ifChain,
Action<? super Chain> elseChain) |
default GroovyChain |
GroovyChain.when(Closure<?> test,
java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.when(Closure<?> test,
java.lang.Class<? extends Action<? super Chain>> ifAction,
java.lang.Class<? extends Action<? super Chain>> elseAction) |
default GroovyChain |
GroovyChain.when(Closure<?> test,
Closure<?> handlers) |
default GroovyChain |
GroovyChain.when(Closure<?> test,
Closure<?> ifHandlers,
Closure<?> elseHandlers) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
Action<? super Chain> action) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
Action<? super Chain> onTrue,
Action<? super Chain> onFalse) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
java.lang.Class<? extends Action<? super Chain>> onTrue,
java.lang.Class<? extends Action<? super Chain>> onFalse) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
Closure<?> handlers) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
Closure<?> ifHandlers,
Closure<?> elseHandlers) |