public static class Route.Collection extends Object implements Route.Props<Route.Collection>
Route.Props
useful for registering/setting route options at once.
See Router#get(String, String, String, OneArgHandler)
and variants.Constructor and Description |
---|
Collection(Route.Props... definitions)
Creates a new collection of route definitions.
|
Modifier and Type | Method and Description |
---|---|
Route.Collection |
attr(String name,
Object value)
Set route attribute.
|
Route.Collection |
consumes(List<MediaType> types)
Set the media types the route can consume.
|
Route.Collection |
excludes(List<String> excludes)
Excludes one or more path pattern from this route, useful for filter:
|
Route.Collection |
map(Route.Mapper<?> mapper) |
Route.Collection |
name(String name)
Set the route name.
|
Route.Collection |
produces(List<MediaType> types)
Set the media types the route can produces.
|
String |
renderer()
Explicit renderer to use or
null . |
Route.Collection |
renderer(String name)
Tell jooby what renderer should use to render the output.
|
public Collection(Route.Props... definitions)
definitions
- Collection of route definitions.public Route.Collection name(String name)
Route.Props
Route.Chain.next(String, Request, Response)
name
in interface Route.Props<Route.Collection>
name
- A route's name.public String renderer()
Route.Props
null
.renderer
in interface Route.Props<Route.Collection>
null
.public Route.Collection renderer(String name)
Route.Props
renderer
in interface Route.Props<Route.Collection>
name
- A renderer's name.public Route.Collection consumes(List<MediaType> types)
Route.Props
consumes
in interface Route.Props<Route.Collection>
types
- The media types to test for.public Route.Collection produces(List<MediaType> types)
Route.Props
produces
in interface Route.Props<Route.Collection>
types
- The media types to test for.public Route.Collection attr(String name, Object value)
Route.Props
attr
in interface Route.Props<Route.Collection>
name
- Attribute's name.value
- Attribute's value.public Route.Collection excludes(List<String> excludes)
Route.Props
{ use("*", req -> { ... }).excludes("/logout"); }
excludes
in interface Route.Props<Route.Collection>
excludes
- A path pattern.public Route.Collection map(Route.Mapper<?> mapper)
map
in interface Route.Props<Route.Collection>
Copyright © 2019. All rights reserved.