public static class ComponentRoute.ComponentRouteBuilder extends Object
public ComponentRoute.ComponentRouteBuilder and(Predicate<org.springframework.web.context.request.WebRequest> predicate)
public ComponentRoute.ComponentRouteBuilder or(Predicate<org.springframework.web.context.request.WebRequest> predicate)
public ComponentRoute.ComponentRouteBuilder negate()
public ComponentRoute.ComponentRouteBuilder path(String path)
This supports any valid URL path that https://github.com/pillarjs/path-to-regexp/tree/v1.7.0 understands, e.g. "/products", "/products/:id", and "/categories/:id?" are all valid URL paths. Must start with a slash, and optionally may include any path parameters as necessary.
this
.public ComponentRoute.ComponentRouteBuilder componentId(String componentId)
Component.id(java.lang.String)
of the Component
that will be rendered for this route.this
.public ComponentRoute.ComponentRouteBuilder componentName(String componentName)
componentId
for non-metadata-driven components like "not found"
views.
This should not be used if componentId
is provided.this
.public ComponentRoute.ComponentRouteBuilder scope(String scope)
public ComponentRoute.ComponentRouteBuilder scopes(Collection<? extends String> scopes)
public ComponentRoute.ComponentRouteBuilder clearScopes()
public ComponentRoute.ComponentRouteBuilder exact(boolean exact)
Whether or not the route requires an exact match to render. This is typically true, but can be set to false when you have a component that needs support for sub-routes.
Setting this to Boolean.FALSE
will allow partial matching of the url. See the table
below for how exact and non-exact routes work.
path | location.pathname | exact | matches? |
---|---|---|---|
/one |
/one/two |
true |
no |
/one |
/one/two |
false |
yes |
Refer to https://reacttraining.com/react-router/web/api/Route/exact-bool for more details.
this
.public ComponentRoute.ComponentRouteBuilder order(int order)
The order of this route. This can be used to ensure that routes are returned in a certain order. The ordering of routes can matter as a route that is provided earlier takes precedence over a route provided later.
As an example, take a route with a path of "/products/create" and one with a path of "/products/:id". If "/products/create" comes after "/products/:id", then it will never be matched, because they are equal precedence and "/products/:id" will match first.
this
.public ComponentRoute.ComponentRouteBuilder predicate(Predicate<org.springframework.web.context.request.WebRequest> predicate)
Predicate
for this route. This will be used to evaluate whether or not this route
should be returned for a given WebRequest
.this
.public ComponentRoute build()
Copyright © 2021. All rights reserved.