Class BLCVariableExpression

java.lang.Object
org.broadleafcommerce.core.web.expression.BLCVariableExpression
All Implemented Interfaces:
org.broadleafcommerce.common.web.expression.BroadleafVariableExpression
Direct Known Subclasses:
PromotionMessageVariableExpression

@Component("blBLCVariableExpression") @ConditionalOnTemplating public class BLCVariableExpression extends Object implements org.broadleafcommerce.common.web.expression.BroadleafVariableExpression
Exposes "blc" to expressions to the Thymeleaf expression context.

This class is intended to be augmented using load time weaving by other modules within Broadleaf.

It provides one function (getDate()) primarily just for testing purposes. This can be accessed with Thymeleaf as ${#blc.date()}

Author:
bpolster
  • Field Details

    • catalogURLService

      protected org.broadleafcommerce.core.catalog.service.CatalogURLService catalogURLService
  • Constructor Details

    • BLCVariableExpression

      public BLCVariableExpression()
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface org.broadleafcommerce.common.web.expression.BroadleafVariableExpression
    • relativeURL

      public String relativeURL(org.broadleafcommerce.core.catalog.domain.Category category)
    • relativeURL

      public String relativeURL(org.broadleafcommerce.core.catalog.domain.Product product)
    • relativeURL

      public String relativeURL(String baseUrl, org.broadleafcommerce.core.catalog.domain.Category category)
    • relativeURL

      public String relativeURL(String baseUrl, org.broadleafcommerce.core.catalog.domain.Product product)
    • getCurrentUrl

      protected String getCurrentUrl()
    • getPrice

      public String getPrice(String amount)
      Returns the price at the correct scale and rounding for the default currency
      Parameters:
      amount -
      Returns:
      See Also:
      • Money.defaultCurrency()