Class ComponentRoute.ComponentRouteBuilder

java.lang.Object
com.broadleafcommerce.metadata.route.ComponentRoute.ComponentRouteBuilder
Enclosing class:
ComponentRoute

public static class ComponentRoute.ComponentRouteBuilder extends Object
  • 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

      public ComponentRoute.ComponentRouteBuilder componentId(String componentId)
      The Component.id(java.lang.String) of the Component that will be rendered for this route.
      Returns:
      this.
    • componentName

      public ComponentRoute.ComponentRouteBuilder componentName(String componentName)
      The name of the component that will be rendered for this route. This can be used as an alternative to using componentId for non-metadata-driven components like "not found" views. This should not be used if componentId is provided.
      Returns:
      this.
    • scope

    • scopes

      public ComponentRoute.ComponentRouteBuilder scopes(Collection<? extends String> scopes)
    • clearScopes

    • exact

      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.

      Returns:
      this.
    • order

      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.

      Returns:
      this.
    • predicate

      public ComponentRoute.ComponentRouteBuilder predicate(Predicate<org.springframework.web.context.request.WebRequest> predicate)
      A Predicate for this route. This will be used to evaluate whether or not this route should be returned for a given WebRequest.
      Returns:
      this.
    • build

      public ComponentRoute build()
    • toString

      public String toString()
      Overrides:
      toString in class Object