java.lang.Object
com.broadleafcommerce.metadata.route.builder.RouteSpec
Direct Known Subclasses:
RouteSpec.RouteBooleanSpec, RouteSpec.RouteBooleanSpec.RouteBooleanOpSpec

public class RouteSpec extends Object
A specification used for creating a ComponentRoute.
Author:
Nick Crum (ncrum)
  • Constructor Details

  • Method Details

    • path

      public RouteSpec path(String path)
      Sets the path of the route.
      Parameters:
      path - the new route path
      Returns:
      this
    • componentId

      public RouteSpec componentId(String componentId)
      Sets the component ID of the route.
      Parameters:
      componentId - the new component ID
      Returns:
      this
    • componentName

      public RouteSpec componentName(String componentName)
      Sets the component name of the route.
      Parameters:
      componentName - the new component name
      Returns:
      this
    • scope

      public RouteSpec scope(String scope)
      Adds the scope to the route.
      Parameters:
      scope - a new scope
      Returns:
      this
    • scopes

      public RouteSpec scopes(List<String> scopes)
      Sets the scopes for the route.
      Parameters:
      scopes - the new scopes
      Returns:
      this
    • clearScopes

      public RouteSpec clearScopes()
      Clears the scopes for the route.
      Returns:
      this
    • order

      public RouteSpec order(int order)
      Sets the absolute ordering of the route. Lower numbers indicate higher precedence.
      Parameters:
      order - the new order of the route
      Returns:
      this
    • exact

      public RouteSpec exact(boolean 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

      public RouteSpec.RouteBooleanSpec 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

      public RouteSpec.RouteBooleanSpec 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

      protected ComponentRoute build()
    • getBean

      protected <B> B getBean(Class<B> beanClass)