Class ComponentRoute.ComponentRouteBuilder
- Enclosing class:
- ComponentRoute
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
componentId
(String componentId) TheComponent.id(java.lang.String)
of theComponent
that will be rendered for this route.componentName
(String componentName) The name of the component that will be rendered for this route.exact
(boolean exact) Whether or not the route requires an exact match to render.negate()
order
(int order) The order of this route.The path for this route in the admin application, e.g.APredicate
for this route.scopes
(Collection<? extends String> scopes) toString()
-
Method Details
-
and
public ComponentRoute.ComponentRouteBuilder and(Predicate<org.springframework.web.context.request.WebRequest> predicate) -
or
public ComponentRoute.ComponentRouteBuilder or(Predicate<org.springframework.web.context.request.WebRequest> predicate) -
negate
-
path
The path for this route in the admin application, e.g. "/products".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.
- Returns:
this
.
-
componentId
TheComponent.id(java.lang.String)
of theComponent
that will be rendered for this route.- Returns:
this
.
-
componentName
The name of the component that will be rendered for this route. This can be used as an alternative to usingcomponentId
for non-metadata-driven components like "not found" views. This should not be used ifcomponentId
is provided.- Returns:
this
.
-
scope
-
scopes
-
clearScopes
-
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.
- Returns:
this
.
-
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.
- Returns:
this
.
-
predicate
public ComponentRoute.ComponentRouteBuilder predicate(Predicate<org.springframework.web.context.request.WebRequest> predicate) APredicate
for this route. This will be used to evaluate whether or not this route should be returned for a givenWebRequest
.- Returns:
this
.
-
build
-
toString
-