org.broadleafcommerce.openadmin.server.service.persistence.module.provider
Class AbstractMoneyFieldPersistenceProvider

java.lang.Object
  extended by org.broadleafcommerce.openadmin.server.service.persistence.module.provider.AbstractFieldPersistenceProvider
      extended by org.broadleafcommerce.openadmin.server.service.persistence.module.provider.FieldPersistenceProviderAdapter
          extended by org.broadleafcommerce.openadmin.server.service.persistence.module.provider.AbstractMoneyFieldPersistenceProvider
All Implemented Interfaces:
FieldPersistenceProvider, org.springframework.core.Ordered
Direct Known Subclasses:
MoneyFieldPersistenceProvider

public abstract class AbstractMoneyFieldPersistenceProvider
extends FieldPersistenceProviderAdapter

Abstract persistence provider that provides a method to actually handle formatting moneys.

Author:
Andre Azzolini (apazzolini)

Field Summary
 
Fields inherited from interface org.broadleafcommerce.openadmin.server.service.persistence.module.provider.FieldPersistenceProvider
BASIC, MAP_FIELD, MEDIA, MONEY, RULE
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
AbstractMoneyFieldPersistenceProvider()
           
 
Method Summary
protected abstract  boolean canHandleExtraction(ExtractValueRequest extractValueRequest, Property property)
           
 FieldProviderResponse extractValue(ExtractValueRequest extractValueRequest, Property property)
          Retrieve the property value from the requestedValue field from the request.
protected  String formatDisplayValue(BigDecimal value, ExtractValueRequest extractValueRequest, Property property)
           
protected  String formatValue(BigDecimal value, ExtractValueRequest extractValueRequest, Property property)
           
protected abstract  Currency getCurrency(ExtractValueRequest extractValueRequest, Property property)
           
protected abstract  Locale getLocale(ExtractValueRequest extractValueRequest, Property property)
           
 
Methods inherited from class org.broadleafcommerce.openadmin.server.service.persistence.module.provider.FieldPersistenceProviderAdapter
addSearchMapping, filterProperties, getOrder, populateValue
 
Methods inherited from class org.broadleafcommerce.openadmin.server.service.persistence.module.provider.AbstractFieldPersistenceProvider
buildFieldInfo, getListFieldType, getMapFieldType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMoneyFieldPersistenceProvider

public AbstractMoneyFieldPersistenceProvider()
Method Detail

extractValue

public FieldProviderResponse extractValue(ExtractValueRequest extractValueRequest,
                                          Property property)
                                   throws PersistenceException
Description copied from interface: FieldPersistenceProvider
Retrieve the property value from the requestedValue field from the request. Implementations should translate the requestedValue and set on the property parameter. The requestedValue is the field value taken from the JPA managed entity instance. You are taking this field value and converting it into a string representation appropriate for the property instance parameter. Used during admin fetch events.

Specified by:
extractValue in interface FieldPersistenceProvider
Overrides:
extractValue in class FieldPersistenceProviderAdapter
Parameters:
extractValueRequest - contains the requested value and support classes.
property - the property for the admin that will contain the information harvested from the persistence value
Returns:
whether or not the implementation handled the persistence request
Throws:
PersistenceException

formatValue

protected String formatValue(BigDecimal value,
                             ExtractValueRequest extractValueRequest,
                             Property property)

formatDisplayValue

protected String formatDisplayValue(BigDecimal value,
                                    ExtractValueRequest extractValueRequest,
                                    Property property)

canHandleExtraction

protected abstract boolean canHandleExtraction(ExtractValueRequest extractValueRequest,
                                               Property property)

getLocale

protected abstract Locale getLocale(ExtractValueRequest extractValueRequest,
                                    Property property)

getCurrency

protected abstract Currency getCurrency(ExtractValueRequest extractValueRequest,
                                        Property property)


Copyright © 2013. All Rights Reserved.