Package ratpack.groovy.handling
Interface GroovyByContentSpec
-
- All Superinterfaces:
ratpack.handling.ByContentSpec
- All Known Implementing Classes:
DefaultGroovyByContentSpec
public interface GroovyByContentSpec extends ratpack.handling.ByContentSpec
A Groovy oriented content negotiation handler builder.- Since:
- 1.5
- See Also:
GroovyContext.byMethod(Closure)
,ByMethodSpec
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default GroovyByContentSpec
html(Closure<?> handler)
Specifies that the given handler should be used if the client wants content of type "text/html".GroovyByContentSpec
html(java.lang.Class<? extends ratpack.handling.Handler> handlerType)
GroovyByContentSpec
html(ratpack.func.Block block)
GroovyByContentSpec
html(ratpack.handling.Handler handler)
default GroovyByContentSpec
json(Closure<?> handler)
Specifies that the given handler should be used if the client wants content of type "application/json".GroovyByContentSpec
json(java.lang.Class<? extends ratpack.handling.Handler> handlerType)
GroovyByContentSpec
json(ratpack.func.Block block)
GroovyByContentSpec
json(ratpack.handling.Handler handler)
default GroovyByContentSpec
noMatch(Closure<?> handler)
Specifies that the given handler should be used if the client's requested content type cannot be matched with any of the other handlers.GroovyByContentSpec
noMatch(java.lang.Class<? extends ratpack.handling.Handler> handlerType)
GroovyByContentSpec
noMatch(java.lang.String mimeType)
GroovyByContentSpec
noMatch(ratpack.func.Block block)
GroovyByContentSpec
noMatch(ratpack.handling.Handler handler)
default GroovyByContentSpec
plainText(Closure<?> handler)
Specifies that the given handler should be used if the client wants content of type "text/plain".GroovyByContentSpec
plainText(java.lang.Class<? extends ratpack.handling.Handler> handlerType)
GroovyByContentSpec
plainText(ratpack.func.Block block)
GroovyByContentSpec
plainText(ratpack.handling.Handler handler)
default GroovyByContentSpec
type(java.lang.CharSequence mimeType, Closure<?> handler)
Specifies that the given handler should be used if the client wants content of the given MIME type.GroovyByContentSpec
type(java.lang.CharSequence mimeType, java.lang.Class<? extends ratpack.handling.Handler> handlerType)
GroovyByContentSpec
type(java.lang.CharSequence mimeType, ratpack.func.Block block)
GroovyByContentSpec
type(java.lang.CharSequence mimeType, ratpack.handling.Handler handler)
default GroovyByContentSpec
type(java.lang.String mimeType, Closure<?> handler)
Specifies that the given handler should be used if the client wants content of the given MIME type.GroovyByContentSpec
type(java.lang.String mimeType, java.lang.Class<? extends ratpack.handling.Handler> handlerType)
GroovyByContentSpec
type(java.lang.String mimeType, ratpack.func.Block block)
GroovyByContentSpec
type(java.lang.String mimeType, ratpack.handling.Handler handler)
default GroovyByContentSpec
unspecified(Closure<?> handler)
Specifies that the given handler should be used if the client did not provide a usable "Accept" header in the request.GroovyByContentSpec
unspecified(java.lang.Class<? extends ratpack.handling.Handler> handlerType)
GroovyByContentSpec
unspecified(java.lang.String mimeType)
GroovyByContentSpec
unspecified(ratpack.func.Block block)
GroovyByContentSpec
unspecified(ratpack.handling.Handler handler)
default GroovyByContentSpec
xml(Closure<?> handler)
Specifies that the given handler should be used if the client wants content of type "application/xml".GroovyByContentSpec
xml(java.lang.Class<? extends ratpack.handling.Handler> handlerType)
GroovyByContentSpec
xml(ratpack.func.Block block)
GroovyByContentSpec
xml(ratpack.handling.Handler handler)
-
-
-
Method Detail
-
type
default GroovyByContentSpec type(java.lang.String mimeType, @DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Specifies that the given handler should be used if the client wants content of the given MIME type. This only supports fully-specified content types (no "*" wildcards).- Parameters:
mimeType
- the MIME type to register forhandler
- the handler to invoke if the content type matches- Returns:
- this
-
type
default GroovyByContentSpec type(java.lang.CharSequence mimeType, @DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Specifies that the given handler should be used if the client wants content of the given MIME type. This only supports fully-specified content types (no "*" wildcards).- Parameters:
mimeType
- the MIME type to register forhandler
- the handler to invoke if the content type matches- Returns:
- this
- Since:
- 1.6
-
plainText
default GroovyByContentSpec plainText(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Specifies that the given handler should be used if the client wants content of type "text/plain".- Parameters:
handler
- the handler to invoke if the content type matches- Returns:
- this
-
html
default GroovyByContentSpec html(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Specifies that the given handler should be used if the client wants content of type "text/html".- Parameters:
handler
- the handler to invoke if the content type matches- Returns:
- this
-
json
default GroovyByContentSpec json(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Specifies that the given handler should be used if the client wants content of type "application/json".- Parameters:
handler
- the handler to invoke if the content type matches- Returns:
- this
-
xml
default GroovyByContentSpec xml(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Specifies that the given handler should be used if the client wants content of type "application/xml".- Parameters:
handler
- the handler to invoke if the content type matches- Returns:
- this
-
noMatch
default GroovyByContentSpec noMatch(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Specifies that the given handler should be used if the client's requested content type cannot be matched with any of the other handlers.- Parameters:
handler
- the handler to invoke if the content type matches- Returns:
- this
-
unspecified
default GroovyByContentSpec unspecified(@DelegatesTo(value=GroovyContext.class,strategy=1) Closure<?> handler)
Specifies that the given handler should be used if the client did not provide a usable "Accept" header in the request.- Parameters:
handler
- the handler to invoke if if no usable "Accept" header is present in the request.- Returns:
- this
-
type
GroovyByContentSpec type(java.lang.String mimeType, ratpack.func.Block block)
- Specified by:
type
in interfaceratpack.handling.ByContentSpec
-
type
GroovyByContentSpec type(java.lang.CharSequence mimeType, ratpack.func.Block block)
- Specified by:
type
in interfaceratpack.handling.ByContentSpec
-
type
GroovyByContentSpec type(java.lang.String mimeType, ratpack.handling.Handler handler)
- Specified by:
type
in interfaceratpack.handling.ByContentSpec
-
type
GroovyByContentSpec type(java.lang.CharSequence mimeType, ratpack.handling.Handler handler)
- Specified by:
type
in interfaceratpack.handling.ByContentSpec
-
type
GroovyByContentSpec type(java.lang.String mimeType, java.lang.Class<? extends ratpack.handling.Handler> handlerType)
- Specified by:
type
in interfaceratpack.handling.ByContentSpec
-
type
GroovyByContentSpec type(java.lang.CharSequence mimeType, java.lang.Class<? extends ratpack.handling.Handler> handlerType)
- Specified by:
type
in interfaceratpack.handling.ByContentSpec
-
plainText
GroovyByContentSpec plainText(ratpack.func.Block block)
- Specified by:
plainText
in interfaceratpack.handling.ByContentSpec
-
plainText
GroovyByContentSpec plainText(ratpack.handling.Handler handler)
- Specified by:
plainText
in interfaceratpack.handling.ByContentSpec
-
plainText
GroovyByContentSpec plainText(java.lang.Class<? extends ratpack.handling.Handler> handlerType)
- Specified by:
plainText
in interfaceratpack.handling.ByContentSpec
-
html
GroovyByContentSpec html(ratpack.func.Block block)
- Specified by:
html
in interfaceratpack.handling.ByContentSpec
-
html
GroovyByContentSpec html(ratpack.handling.Handler handler)
- Specified by:
html
in interfaceratpack.handling.ByContentSpec
-
html
GroovyByContentSpec html(java.lang.Class<? extends ratpack.handling.Handler> handlerType)
- Specified by:
html
in interfaceratpack.handling.ByContentSpec
-
json
GroovyByContentSpec json(ratpack.func.Block block)
- Specified by:
json
in interfaceratpack.handling.ByContentSpec
-
json
GroovyByContentSpec json(ratpack.handling.Handler handler)
- Specified by:
json
in interfaceratpack.handling.ByContentSpec
-
json
GroovyByContentSpec json(java.lang.Class<? extends ratpack.handling.Handler> handlerType)
- Specified by:
json
in interfaceratpack.handling.ByContentSpec
-
xml
GroovyByContentSpec xml(ratpack.func.Block block)
- Specified by:
xml
in interfaceratpack.handling.ByContentSpec
-
xml
GroovyByContentSpec xml(ratpack.handling.Handler handler)
- Specified by:
xml
in interfaceratpack.handling.ByContentSpec
-
xml
GroovyByContentSpec xml(java.lang.Class<? extends ratpack.handling.Handler> handlerType)
- Specified by:
xml
in interfaceratpack.handling.ByContentSpec
-
noMatch
GroovyByContentSpec noMatch(ratpack.func.Block block)
- Specified by:
noMatch
in interfaceratpack.handling.ByContentSpec
-
noMatch
GroovyByContentSpec noMatch(ratpack.handling.Handler handler)
- Specified by:
noMatch
in interfaceratpack.handling.ByContentSpec
-
noMatch
GroovyByContentSpec noMatch(java.lang.Class<? extends ratpack.handling.Handler> handlerType)
- Specified by:
noMatch
in interfaceratpack.handling.ByContentSpec
-
noMatch
GroovyByContentSpec noMatch(java.lang.String mimeType)
- Specified by:
noMatch
in interfaceratpack.handling.ByContentSpec
-
unspecified
GroovyByContentSpec unspecified(ratpack.func.Block block)
- Specified by:
unspecified
in interfaceratpack.handling.ByContentSpec
-
unspecified
GroovyByContentSpec unspecified(ratpack.handling.Handler handler)
- Specified by:
unspecified
in interfaceratpack.handling.ByContentSpec
-
unspecified
GroovyByContentSpec unspecified(java.lang.Class<? extends ratpack.handling.Handler> handlerType)
- Specified by:
unspecified
in interfaceratpack.handling.ByContentSpec
-
unspecified
GroovyByContentSpec unspecified(java.lang.String mimeType)
- Specified by:
unspecified
in interfaceratpack.handling.ByContentSpec
-
-