org.broadleafcommerce.core.web.api.wrapper
Class CategoryWrapper

java.lang.Object
  extended by org.broadleafcommerce.core.web.api.wrapper.BaseWrapper
      extended by org.broadleafcommerce.core.web.api.wrapper.CategoryWrapper
All Implemented Interfaces:
APIWrapper<Category>, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

public class CategoryWrapper
extends BaseWrapper
implements APIWrapper<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;


Field Summary
protected  Boolean active
           
protected  Date activeEndDate
           
protected  Date activeStartDate
           
protected  List<CategoryAttributeWrapper> categoryAttributes
           
protected  String description
           
protected  Long id
           
protected  String name
           
protected  List<ProductWrapper> products
           
protected  List<CategoryWrapper> subcategories
           
protected  String url
           
protected  String urlKey
           
 
Fields inherited from class org.broadleafcommerce.core.web.api.wrapper.BaseWrapper
context
 
Constructor Summary
CategoryWrapper()
           
 
Method Summary
protected  List<CategoryWrapper> buildSubcategoryTree(List<CategoryWrapper> wrappers, Category root, javax.servlet.http.HttpServletRequest request)
           
 void wrapDetails(Category category, javax.servlet.http.HttpServletRequest request)
           
 void wrapSummary(Category category, javax.servlet.http.HttpServletRequest request)
           
 
Methods inherited from class org.broadleafcommerce.core.web.api.wrapper.BaseWrapper
setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected Long id

name

protected String name

description

protected String description

active

protected Boolean active

url

protected String url

urlKey

protected String urlKey

activeStartDate

protected Date activeStartDate

activeEndDate

protected Date activeEndDate

subcategories

protected List<CategoryWrapper> subcategories

products

protected List<ProductWrapper> products

categoryAttributes

protected List<CategoryAttributeWrapper> categoryAttributes
Constructor Detail

CategoryWrapper

public CategoryWrapper()
Method Detail

wrapDetails

public void wrapDetails(Category category,
                        javax.servlet.http.HttpServletRequest request)
Specified by:
wrapDetails in interface APIWrapper<Category>

wrapSummary

public void wrapSummary(Category category,
                        javax.servlet.http.HttpServletRequest request)
Specified by:
wrapSummary in interface APIWrapper<Category>

buildSubcategoryTree

protected List<CategoryWrapper> buildSubcategoryTree(List<CategoryWrapper> wrappers,
                                                     Category root,
                                                     javax.servlet.http.HttpServletRequest request)


Copyright © 2013. All Rights Reserved.