Class PriceFactorySwitcher
- java.lang.Object
-
- de.hybris.platform.jalo.Manager
-
- de.hybris.platform.jalo.extension.Extension
-
- de.hybris.platform.jalo.order.price.AbstractPriceFactory
-
- de.hybris.platform.europe1.jalo.GeneratedEurope1PriceFactory
-
- de.hybris.platform.europe1.jalo.Europe1PriceFactory
-
- de.hybris.platform.catalog.jalo.CatalogAwareEurope1PriceFactory
-
- de.hybris.platform.order.strategies.calculation.impl.internal.PriceFactorySwitcher
-
- All Implemented Interfaces:
ItemLifecycleListener,PriceFactory,java.io.Serializable
public final class PriceFactorySwitcher extends CatalogAwareEurope1PriceFactory
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.europe1.jalo.Europe1PriceFactory
Europe1PriceFactory.CachedTax, Europe1PriceFactory.CachedTaxValue, Europe1PriceFactory.DiscountRowMatchComparator, Europe1PriceFactory.PriceRowInfoComparator, Europe1PriceFactory.PriceRowMatchComparator, Europe1PriceFactory.TaxRowMatchComparator
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.extension.Extension
Extension.RestrictedLanguagesProvider, Extension.RightsProvider
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.Manager
Manager.GenericManagerSingletonCreator, Manager.ManagerSingletonCreator
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.europe1.jalo.Europe1PriceFactory
MATCH_ANY, MATCH_BY_PRODUCT_ID, USE_FAST_ALGORITHMS
-
Fields inherited from class de.hybris.platform.europe1.jalo.GeneratedEurope1PriceFactory
DEFAULT_INITIAL_ATTRIBUTES, PRODUCT2OWNEUROPE1DISCOUNTSOWNEUROPE1DISCOUNTSHANDLER, PRODUCT2OWNEUROPE1PRICESOWNEUROPE1PRICESHANDLER, PRODUCT2OWNEUROPE1TAXESOWNEUROPE1TAXESHANDLER, USER2OWNEUROPE1DISCOUNTSOWNEUROPE1DISCOUNTSHANDLER
-
-
Constructor Summary
Constructors Constructor Description PriceFactorySwitcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProductPriceInformationsgetAllPriceInformations(SessionContext ctx, Product product, java.util.Date date, boolean net)Calculates a product price quote containing all applicable prices, discounts and taxes for the given product and net/gross state.PriceValuegetBasePrice(AbstractOrderEntry entry)override to define the base price of an order entryjava.util.List<DiscountValue>getDiscountValues(AbstractOrder order)override to define (global) discounts for an order.java.util.List<DiscountValue>getDiscountValues(AbstractOrderEntry entry)override to define discount values for an order entry.java.util.List<DiscountInformation>getProductDiscountInformations(SessionContext ctx, Product product, java.util.Date date, boolean net)override this to show all discounts which may apply to the given productjava.util.List<PriceInformation>getProductPriceInformations(SessionContext ctx, Product product, java.util.Date date, boolean net)Override this to show all prices available for the given productjava.util.List<TaxInformation>getProductTaxInformations(SessionContext ctx, Product product, java.util.Date date)override this to show all taxes which apply to the given productjava.util.Collection<TaxValue>getTaxValues(AbstractOrderEntry entry)override to define tax values for an order entry.booleanisNetUser(User user)override to define whether a user should be treated as net or gross customer.voidsetDiscountService(DiscountService discountService)voidsetFindDiscountValuesStrategy(FindDiscountValuesStrategy findDiscountValuesStrategy)voidsetFindPriceStrategy(FindPriceStrategy findPriceStrategy)voidsetFindTaxValuesStrategy(FindTaxValuesStrategy findTaxValuesStrategy)voidsetModelService(ModelService modelService)voidsetPriceService(PriceService priceService)voidsetPricingCustomizationDetector(PricingCustomizationDetector pricingCustomizationDetector)voidsetTaxService(TaxService taxService)voidsetUserNetCheckingStrategy(UserNetCheckingStrategy userNetCheckingStrategy)-
Methods inherited from class de.hybris.platform.europe1.jalo.Europe1PriceFactory
adjustDate, appendProductConditions, appendUserConditions, beforeItemCreation, checkAllDiscountRows, checkAllDiscountRows, checkAllGlobalDiscountRows, checkAllGlobalDiscountRows, checkAllPriceRows, checkAllPriceRows, checkAllTaxRows, checkAllTaxRows, checkBeforeItemRemoval, createDiscountRow, createDiscountRow, createEssentialData, createGlobalDiscountRow, createGlobalDiscountRow, createPriceRow, createPriceRow, createPriceRow, createPriceRow, createProductTaxGroup, createProjectData, createTaxRow, createTaxRow, createTaxRow, createUserPriceGroup, createUserTaxGroup, extractProductId, extractProductId, fillTaxCache, filterDiscountRows4Price, filterPriceRows, filterPriceRows4Info, filterPriceRows4Price, filterTaxRows4Price, getCachedTaxes, getCounterpartItem, getCounterpartItem, getCounterpartItem, getDiscountInformations, getEnumFromContextOrItem, getEnumFromGroups, getEurope1Discounts, getEurope1Discounts, getEurope1Discounts, getEurope1Discounts, getEurope1Prices, getEurope1Prices, getEurope1Taxes, getEurope1Taxes, getInstance, getPDG, getPDG, getPDTRowsQueryBuilderFor, getPPG, getPPG, getPriceInformations, getProductDiscountRows, getProductDiscountRows, getProductDiscountRowsFast, getProductPriceRows, getProductPriceRows, getProductPriceRowsFast, getProductTaxGroup, getProductTaxRows, getProductTaxRows, getProductTaxRowsFast, getPTG, getPTG, getRealPartOfPriceRows, getSuperCachedTaxes, getTaxInformations, getUDG, getUDG, getUDG, getUPG, getUPG, getUPG, getUserGlobalDiscountRows, getUserPriceGroup, getUserTaxGroup, getUTG, getUTG, getUTG, init, invalidateTaxCache, isCachingTaxes, isCreatorDisabled, matchDiscountRows, matchPriceRowForPrice, matchPriceRowsForInfo, matchTaxRows, notifyItemRemoval, queryDiscounts4Price, queryPriceRows4Price, queryPriceRows4Price, queryTax4Price, removeRowsFor, removeRowsFor, removeRowsFor, removeRowsFor, removeRowsFor, removeRowsFor, removeRowsFor, setEurope1Discounts, setEurope1Discounts, setEurope1Discounts, setEurope1Discounts, setEurope1Prices, setEurope1Prices, setEurope1Taxes, setEurope1Taxes, setRetrieveChannelStrategy, superQueryTax4Price
-
Methods inherited from class de.hybris.platform.europe1.jalo.GeneratedEurope1PriceFactory
addToOwnEurope1Discounts, addToOwnEurope1Discounts, addToOwnEurope1Discounts, addToOwnEurope1Discounts, addToOwnEurope1Prices, addToOwnEurope1Prices, addToOwnEurope1Taxes, addToOwnEurope1Taxes, createDiscountRow, createDiscountRow, createGlobalDiscountRow, createGlobalDiscountRow, createPriceRow, createPriceRow, createTaxRow, createTaxRow, getDefaultAttributeModes, getEurope1PriceFactory_PDG, getEurope1PriceFactory_PDG, getEurope1PriceFactory_PDG, getEurope1PriceFactory_PDG, getEurope1PriceFactory_PPG, getEurope1PriceFactory_PPG, getEurope1PriceFactory_PPG, getEurope1PriceFactory_PPG, getEurope1PriceFactory_PTG, getEurope1PriceFactory_PTG, getEurope1PriceFactory_PTG, getEurope1PriceFactory_PTG, getEurope1PriceFactory_UDG, getEurope1PriceFactory_UDG, getEurope1PriceFactory_UDG, getEurope1PriceFactory_UDG, getEurope1PriceFactory_UPG, getEurope1PriceFactory_UPG, getEurope1PriceFactory_UPG, getEurope1PriceFactory_UPG, getEurope1PriceFactory_UTG, getEurope1PriceFactory_UTG, getEurope1PriceFactory_UTG, getEurope1PriceFactory_UTG, getName, getOwnEurope1Discounts, getOwnEurope1Discounts, getOwnEurope1Discounts, getOwnEurope1Discounts, getOwnEurope1Prices, getOwnEurope1Prices, getOwnEurope1Taxes, getOwnEurope1Taxes, getUserDiscountGroup, getUserDiscountGroup, getUserPriceGroup, getUserPriceGroup, getUserTaxGroup, getUserTaxGroup, removeFromOwnEurope1Discounts, removeFromOwnEurope1Discounts, removeFromOwnEurope1Discounts, removeFromOwnEurope1Discounts, removeFromOwnEurope1Prices, removeFromOwnEurope1Prices, removeFromOwnEurope1Taxes, removeFromOwnEurope1Taxes, setEurope1PriceFactory_PDG, setEurope1PriceFactory_PDG, setEurope1PriceFactory_PDG, setEurope1PriceFactory_PDG, setEurope1PriceFactory_PPG, setEurope1PriceFactory_PPG, setEurope1PriceFactory_PPG, setEurope1PriceFactory_PPG, setEurope1PriceFactory_PTG, setEurope1PriceFactory_PTG, setEurope1PriceFactory_PTG, setEurope1PriceFactory_PTG, setEurope1PriceFactory_UDG, setEurope1PriceFactory_UDG, setEurope1PriceFactory_UDG, setEurope1PriceFactory_UDG, setEurope1PriceFactory_UPG, setEurope1PriceFactory_UPG, setEurope1PriceFactory_UPG, setEurope1PriceFactory_UPG, setEurope1PriceFactory_UTG, setEurope1PriceFactory_UTG, setEurope1PriceFactory_UTG, setEurope1PriceFactory_UTG, setOwnEurope1Discounts, setOwnEurope1Discounts, setOwnEurope1Discounts, setOwnEurope1Discounts, setOwnEurope1Prices, setOwnEurope1Prices, setOwnEurope1Taxes, setOwnEurope1Taxes, setUserDiscountGroup, setUserDiscountGroup, setUserPriceGroup, setUserPriceGroup, setUserTaxGroup, setUserTaxGroup
-
Methods inherited from class de.hybris.platform.jalo.order.price.AbstractPriceFactory
getAllPriceInformations, getProductDiscountInformations, getProductPriceInformations, getProductTaxInformations
-
Methods inherited from class de.hybris.platform.jalo.extension.Extension
createSampleData, getCreatorDescription, getCreatorName, getCreatorParameterDefault, getCreatorParameterNames, getCreatorParameterPossibleValues, getRemote, notifyInitializationEnd, notifyInitializationStart, onFirstSessionCreation, writeReplace
-
Methods inherited from class de.hybris.platform.jalo.Manager
afterItemCreation, destroy, extractNonRequiredRemoteFromItem, extractRequiredRemoteFromItem, getAllValuesSessionContext, getAttribute, getAttributeMap, getFirstItemByAttribute, getFirstItemByAttribute, getRemoteManagerClass, getSession, getSingletonManagerInstance, getTenant, getTransientObject, getTransientObjectMap, setAttribute, setTenant, setTransientObject, wrap
-
-
-
-
Method Detail
-
getAllPriceInformations
public ProductPriceInformations getAllPriceInformations(SessionContext ctx, Product product, java.util.Date date, boolean net) throws JaloPriceFactoryException
Description copied from class:AbstractPriceFactoryCalculates a product price quote containing all applicable prices, discounts and taxes for the given product and net/gross state.This default implementation just calls
AbstractPriceFactory.getProductPriceInformations(Product, Date, boolean),AbstractPriceFactory.getProductTaxInformations(Product, Date)andAbstractPriceFactory.getProductDiscountInformations(Product, Date, boolean)and wraps the results inside aProductPriceInformationsobject.Override to define the prices, taxes and discounts for all occasions when no order or order entry is available, e.g. for product lists. Please take care also to override
AbstractPriceFactory.getProductPriceInformations(Product, Date, boolean),AbstractPriceFactory.getProductTaxInformations(Product, Date)andAbstractPriceFactory.getProductDiscountInformations(Product, Date, boolean)since these methods are called byProductdirectly.- Specified by:
getAllPriceInformationsin interfacePriceFactory- Overrides:
getAllPriceInformationsin classEurope1PriceFactory- Throws:
JaloPriceFactoryException- if a calculation error occured
-
getProductPriceInformations
public java.util.List<PriceInformation> getProductPriceInformations(SessionContext ctx, Product product, java.util.Date date, boolean net) throws JaloPriceFactoryException
Description copied from class:AbstractPriceFactoryOverride this to show all prices available for the given product- Specified by:
getProductPriceInformationsin interfacePriceFactory- Overrides:
getProductPriceInformationsin classEurope1PriceFactoryproduct- the productnet- the net/gross state of the requested prices- Returns:
- a list of
PriceInformationobjects - Throws:
JaloPriceFactoryException- if price calculation error occured
-
getProductTaxInformations
public java.util.List<TaxInformation> getProductTaxInformations(SessionContext ctx, Product product, java.util.Date date) throws JaloPriceFactoryException
Description copied from class:AbstractPriceFactoryoverride this to show all taxes which apply to the given product- Specified by:
getProductTaxInformationsin interfacePriceFactory- Overrides:
getProductTaxInformationsin classEurope1PriceFactoryproduct- the product- Returns:
- a list of
TaxInformationobjects - Throws:
JaloPriceFactoryException- if price calculation error occured
-
getProductDiscountInformations
public java.util.List<DiscountInformation> getProductDiscountInformations(SessionContext ctx, Product product, java.util.Date date, boolean net) throws JaloPriceFactoryException
Description copied from class:AbstractPriceFactoryoverride this to show all discounts which may apply to the given product- Specified by:
getProductDiscountInformationsin interfacePriceFactory- Overrides:
getProductDiscountInformationsin classEurope1PriceFactoryproduct- the product- Returns:
- a list of
DiscountInformationobjects - Throws:
JaloPriceFactoryException- if price calculation error occured
-
isNetUser
public boolean isNetUser(User user)
Description copied from class:AbstractPriceFactoryoverride to define whether a user should be treated as net or gross customer.- Specified by:
isNetUserin interfacePriceFactory- Overrides:
isNetUserin classAbstractPriceFactory- Returns:
- false as default
-
getTaxValues
public java.util.Collection<TaxValue> getTaxValues(AbstractOrderEntry entry) throws JaloPriceFactoryException
Description copied from class:AbstractPriceFactoryoverride to define tax values for an order entry.- Specified by:
getTaxValuesin interfacePriceFactory- Overrides:
getTaxValuesin classEurope1PriceFactory- Returns:
- empty list as default
- Throws:
JaloPriceFactoryException
-
getBasePrice
public PriceValue getBasePrice(AbstractOrderEntry entry) throws JaloPriceFactoryException
Description copied from class:AbstractPriceFactoryoverride to define the base price of an order entry- Specified by:
getBasePricein interfacePriceFactory- Overrides:
getBasePricein classEurope1PriceFactory- Returns:
- a price with the order's currency iso code, 0.0 as value and the order's net status
- Throws:
JaloPriceFactoryException
-
getDiscountValues
public java.util.List<DiscountValue> getDiscountValues(AbstractOrderEntry entry) throws JaloPriceFactoryException
Description copied from class:AbstractPriceFactoryoverride to define discount values for an order entry.- Specified by:
getDiscountValuesin interfacePriceFactory- Overrides:
getDiscountValuesin classEurope1PriceFactory- Returns:
- empty list as default
- Throws:
JaloPriceFactoryException
-
getDiscountValues
public java.util.List<DiscountValue> getDiscountValues(AbstractOrder order) throws JaloPriceFactoryException
Description copied from class:AbstractPriceFactoryoverride to define (global) discounts for an order. these discounts are applied to the whole order, not just to one entry likeAbstractPriceFactory.getDiscountValues(AbstractOrderEntry)- Specified by:
getDiscountValuesin interfacePriceFactory- Overrides:
getDiscountValuesin classEurope1PriceFactory- Returns:
- empty list as default
- Throws:
JaloPriceFactoryException
-
setModelService
public void setModelService(ModelService modelService)
-
setTaxService
public void setTaxService(TaxService taxService)
-
setDiscountService
public void setDiscountService(DiscountService discountService)
-
setPriceService
public void setPriceService(PriceService priceService)
-
setUserNetCheckingStrategy
public void setUserNetCheckingStrategy(UserNetCheckingStrategy userNetCheckingStrategy)
-
setFindPriceStrategy
public void setFindPriceStrategy(FindPriceStrategy findPriceStrategy)
-
setFindTaxValuesStrategy
public void setFindTaxValuesStrategy(FindTaxValuesStrategy findTaxValuesStrategy)
-
setFindDiscountValuesStrategy
public void setFindDiscountValuesStrategy(FindDiscountValuesStrategy findDiscountValuesStrategy)
-
setPricingCustomizationDetector
public void setPricingCustomizationDetector(PricingCustomizationDetector pricingCustomizationDetector)
-
-