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
3. Within the wrap method, either override all properties that you want to set, or call
4. Set additional property values that you have added.
5. Set super properties to null if you do not want them serialized. (e.g.
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 Summary
FieldsModifier and TypeFieldDescriptionprotected Booleanprotected Dateprotected Dateprotected Characterprotected List<CategoryAttributeWrapper>protected Stringprotected Longprotected Stringprotected Stringprotected List<ProductWrapper>protected List<ProductWrapper>protected List<CategoryWrapper>protected Stringprotected StringFields inherited from class org.broadleafcommerce.common.rest.api.wrapper.BaseWrapper
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<CategoryWrapper>buildSubcategoryTree(List<CategoryWrapper> wrappers, org.broadleafcommerce.core.catalog.domain.Category root, jakarta.servlet.http.HttpServletRequest request) getId()getName()protected org.broadleafcommerce.core.search.service.SearchServicegetUrl()voidvoidsetActiveEndDate(Date activeEndDate) voidsetActiveStartDate(Date activeStartDate) voidsetArchived(Character archived) voidsetCategoryAttributes(List<CategoryAttributeWrapper> categoryAttributes) voidsetDescription(String description) voidvoidsetLongDescription(String longDescription) voidvoidsetProducts(List<ProductWrapper> products) voidsetSubcategories(List<CategoryWrapper> subcategories) voidvoidvoidwrapDetails(org.broadleafcommerce.core.catalog.domain.Category category, jakarta.servlet.http.HttpServletRequest request) voidwrapSummary(org.broadleafcommerce.core.catalog.domain.Category category, jakarta.servlet.http.HttpServletRequest request) Methods inherited from class org.broadleafcommerce.common.rest.api.wrapper.BaseWrapper
createElementWrappers, setApplicationContext, transferAdditionalFieldsFromWrapper
-
Field Details
-
id
-
name
-
description
-
longDescription
-
active
-
url
-
urlKey
-
activeStartDate
-
activeEndDate
-
subcategories
-
products
-
categoryAttributes
-
archived
-
-
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:
wrapDetailsin interfaceorg.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:
wrapSummaryin interfaceorg.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
- Returns:
- the id
-
setId
- Parameters:
id- the id to set
-
getName
- Returns:
- the name
-
setName
- Parameters:
name- the name to set
-
getDescription
- Returns:
- the description
-
setDescription
- Parameters:
description- the description to set
-
getLongDescription
- Returns:
- the long description
-
setLongDescription
- Parameters:
longDescription- the long description to set
-
getActive
- Returns:
- the active
-
setActive
- Parameters:
active- the active to set
-
getUrl
- Returns:
- the url
-
setUrl
- Parameters:
url- the url to set
-
getUrlKey
- Returns:
- the urlKey
-
setUrlKey
- Parameters:
urlKey- the urlKey to set
-
getActiveStartDate
- Returns:
- the activeStartDate
-
setActiveStartDate
- Parameters:
activeStartDate- the activeStartDate to set
-
getActiveEndDate
- Returns:
- the activeEndDate
-
setActiveEndDate
- Parameters:
activeEndDate- the activeEndDate to set
-
getSubcategories
- Returns:
- the subcategories
-
setSubcategories
- Parameters:
subcategories- the subcategories to set
-
getProducts
- Returns:
- the products
-
setProducts
- Parameters:
products- the products to set
-
getCategoryAttributes
- Returns:
- the categoryAttributes
-
setCategoryAttributes
- Parameters:
categoryAttributes- the categoryAttributes to set
-
getArchived
-
setArchived
-