Class RouteSpec
java.lang.Object
com.broadleafcommerce.metadata.route.builder.RouteSpec
- Direct Known Subclasses:
RouteSpec.RouteBooleanSpec
,RouteSpec.RouteBooleanSpec.RouteBooleanOpSpec
A specification used for creating a
ComponentRoute
.- Author:
- Nick Crum (ncrum)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A specification extension forRouteSpec
that provides an entry-point to chain together predicates through methodsRouteSpec.RouteBooleanSpec.and()
,RouteSpec.RouteBooleanSpec.or()
, andRouteSpec.RouteBooleanSpec.negate()
. -
Constructor Summary
ConstructorsConstructorDescriptionRouteSpec
(RoutesSpec parent) RouteSpec
(RoutesSpec parent, ComponentRoute.ComponentRouteBuilder routeBuilder) -
Method Summary
Modifier and TypeMethodDescriptionAdds a special predicate to limit this route to only be returned for a strict application context.protected ComponentRoute
build()
Clears the scopes for the route.componentId
(String componentId) Sets the component ID of the route.componentName
(String componentName) Sets the component name of the route.exact
(boolean exact) Sets whether or not the route must match exactly.protected <B> B
order
(int order) Sets the absolute ordering of the route.Sets the path of the route.Sets a predicate for the route.Adds the scope to the route.Sets the scopes for the route.Adds a special predicate for limiting this route to certain tenancy contexts.Adds a special predicate to limit this route to only be returned for a strict tenant context.
-
Constructor Details
-
RouteSpec
-
RouteSpec
-
-
Method Details
-
path
Sets the path of the route.- Parameters:
path
- the new route path- Returns:
- this
-
componentId
Sets the component ID of the route.- Parameters:
componentId
- the new component ID- Returns:
- this
-
componentName
Sets the component name of the route.- Parameters:
componentName
- the new component name- Returns:
- this
-
scope
Adds the scope to the route.- Parameters:
scope
- a new scope- Returns:
- this
-
scopes
Sets the scopes for the route.- Parameters:
scopes
- the new scopes- Returns:
- this
-
clearScopes
Clears the scopes for the route.- Returns:
- this
-
order
Sets the absolute ordering of the route. Lower numbers indicate higher precedence.- Parameters:
order
- the new order of the route- Returns:
- this
-
exact
Sets whether or not the route must match exactly.- Parameters:
exact
- whether or not exact match is required- Returns:
- this
- See Also:
-
predicate
public RouteSpec.RouteBooleanSpec predicate(Predicate<org.springframework.web.context.request.WebRequest> predicate) Sets a predicate for the route.- Parameters:
predicate
- the new predicate- Returns:
- this
-
tenancy
Adds a special predicate for limiting this route to certain tenancy contexts.- Parameters:
fn
- a function to configure the tenancy context- Returns:
- a
RouteSpec.RouteBooleanSpec
to allow chaining of predicates
-
tenantOnly
Adds a special predicate to limit this route to only be returned for a strict tenant context.- Returns:
- a
RouteSpec.RouteBooleanSpec
to allow chaining of predicates
-
applicationOnly
Adds a special predicate to limit this route to only be returned for a strict application context.- Returns:
- a
RouteSpec.RouteBooleanSpec
to allow chaining of predicates
-
build
-
getBean
-