Class CategoryWrapper

java.lang.Object
org.broadleafcommerce.common.rest.api.wrapper.BaseWrapper
com.broadleafcommerce.rest.api.wrapper.CategoryWrapper
All Implemented Interfaces:
Serializable, org.broadleafcommerce.common.rest.api.wrapper.APIWrapper<org.broadleafcommerce.core.catalog.domain.Category>, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

public class CategoryWrapper extends org.broadleafcommerce.common.rest.api.wrapper.BaseWrapper implements org.broadleafcommerce.common.rest.api.wrapper.APIWrapper<org.broadleafcommerce.core.catalog.domain.Category>
This is a JAXB wrapper for a Broadleaf Category. There may be several reasons to extend this class. First, you may want to extend Broadleaf's CategroryImpl and expose those extensions via a RESTful service. You may also want to suppress properties that are being serialized. To expose new properties, or suppress properties that have been exposed, do the following:

1. Extend this class
2. Override the wrap method.
3. Within the wrap method, either override all properties that you want to set, or call super.wrap(Category)
4. Set additional property values that you have added.
5. Set super properties to null if you do not want them serialized. (e.g. super.name = null;
See Also:
  • Field Details

  • Constructor Details

    • CategoryWrapper

      public CategoryWrapper()
  • Method Details

    • wrapDetails

      public void wrapDetails(org.broadleafcommerce.core.catalog.domain.Category category, jakarta.servlet.http.HttpServletRequest request)
      Specified by:
      wrapDetails in interface org.broadleafcommerce.common.rest.api.wrapper.APIWrapper<org.broadleafcommerce.core.catalog.domain.Category>
    • wrapSummary

      public void wrapSummary(org.broadleafcommerce.core.catalog.domain.Category category, jakarta.servlet.http.HttpServletRequest request)
      Specified by:
      wrapSummary in interface org.broadleafcommerce.common.rest.api.wrapper.APIWrapper<org.broadleafcommerce.core.catalog.domain.Category>
    • buildSubcategoryTree

      protected List<CategoryWrapper> buildSubcategoryTree(List<CategoryWrapper> wrappers, org.broadleafcommerce.core.catalog.domain.Category root, jakarta.servlet.http.HttpServletRequest request)
    • getSearchService

      protected org.broadleafcommerce.core.search.service.SearchService getSearchService()
    • getId

      public Long getId()
      Returns:
      the id
    • setId

      public void setId(Long id)
      Parameters:
      id - the id to set
    • getName

      public String getName()
      Returns:
      the name
    • setName

      public void setName(String name)
      Parameters:
      name - the name to set
    • getDescription

      public String getDescription()
      Returns:
      the description
    • setDescription

      public void setDescription(String description)
      Parameters:
      description - the description to set
    • getLongDescription

      public String getLongDescription()
      Returns:
      the long description
    • setLongDescription

      public void setLongDescription(String longDescription)
      Parameters:
      longDescription - the long description to set
    • getActive

      public Boolean getActive()
      Returns:
      the active
    • setActive

      public void setActive(Boolean active)
      Parameters:
      active - the active to set
    • getUrl

      public String getUrl()
      Returns:
      the url
    • setUrl

      public void setUrl(String url)
      Parameters:
      url - the url to set
    • getUrlKey

      public String getUrlKey()
      Returns:
      the urlKey
    • setUrlKey

      public void setUrlKey(String urlKey)
      Parameters:
      urlKey - the urlKey to set
    • getActiveStartDate

      public Date getActiveStartDate()
      Returns:
      the activeStartDate
    • setActiveStartDate

      public void setActiveStartDate(Date activeStartDate)
      Parameters:
      activeStartDate - the activeStartDate to set
    • getActiveEndDate

      public Date getActiveEndDate()
      Returns:
      the activeEndDate
    • setActiveEndDate

      public void setActiveEndDate(Date activeEndDate)
      Parameters:
      activeEndDate - the activeEndDate to set
    • getSubcategories

      public List<CategoryWrapper> getSubcategories()
      Returns:
      the subcategories
    • setSubcategories

      public void setSubcategories(List<CategoryWrapper> subcategories)
      Parameters:
      subcategories - the subcategories to set
    • getProducts

      public List<ProductWrapper> getProducts()
      Returns:
      the products
    • setProducts

      public void setProducts(List<ProductWrapper> products)
      Parameters:
      products - the products to set
    • getCategoryAttributes

      public List<CategoryAttributeWrapper> getCategoryAttributes()
      Returns:
      the categoryAttributes
    • setCategoryAttributes

      public void setCategoryAttributes(List<CategoryAttributeWrapper> categoryAttributes)
      Parameters:
      categoryAttributes - the categoryAttributes to set
    • getArchived

      public Character getArchived()
    • setArchived

      public void setArchived(Character archived)