Class ConverterImpl
- java.lang.Object
-
- de.hybris.platform.sap.core.bol.businessobject.BusinessObjectBase
-
- de.hybris.platform.sap.sapcommonbol.common.businessobject.impl.ConverterImpl
-
- All Implemented Interfaces:
BackendAware,BusinessObject,MessageListHolder,Converter,java.io.Serializable,java.lang.Cloneable
public class ConverterImpl extends BusinessObjectBase implements Converter
Converter implementation. For details see the specifying interfaceConverter- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.sap.core.bol.businessobject.BusinessObjectBase
backendObject, backendType, bobMessages, bobState, extensionData, genericFactory, handle, moduleConfigurationAccess, techKey
-
Fields inherited from interface de.hybris.platform.sap.sapcommonbol.common.businessobject.interf.Converter
BO_TYPE
-
Fields inherited from interface de.hybris.platform.sap.core.common.message.MessageListHolder
INVALID, VALID
-
-
Constructor Summary
Constructors Constructor Description ConverterImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringconvertUnitID2UnitKey(java.lang.String unitID)Converts the unit ID (examplePCfor en_US) into the unit key (exampleST)java.lang.StringconvertUnitKey2UnitID(java.lang.String unitKey)Converts the unit key (exampleST) into the language dependent ID (examplePCfor en_US)ConverterBackendgetBackendService()java.lang.IntegergetCurrencyScale(java.lang.String sapCurrencyCode)Retrieves the number of decimal places for a currency (which might be an ISO currency but doesn't need to be).protected java.math.BigDecimalgetMinimumScaleValue(int scale)java.math.BigDecimalgetMinimumScaleValue(java.lang.String unitKey)intgetUnitScale(java.lang.String unitKey)Retrieves the number of decimal places for units according to ERP/CRM customizing.-
Methods inherited from class de.hybris.platform.sap.core.bol.businessobject.BusinessObjectBase
addExtensionData, addMessage, clearMessages, clearMessages, clearOwnMessages, clone, copyMessages, copyMessages, createUniqueHandle, destroy, determineBackendObject, equals, getBackendBusinessObject, getBackendBusinessObject, getBackendType, getExtensionData, getExtensionDataValues, getExtensionMap, getHandle, getMessageList, getModuleConfigurationAccess, getOwnMessageList, getSubObjectIterator, getTechKey, hasHandle, hashCode, hasMessages, hasOwnMessages, init, isValid, logMessage, removeExtensionData, removeExtensionDataValues, setBackendObject, setBackendType, setExtensionMap, setGenericFactory, setHandle, setInvalid, setModuleConfigurationAccess, setTechKey, setValid, toString
-
-
-
-
Method Detail
-
getBackendService
public ConverterBackend getBackendService() throws BackendException
- Returns:
- the backendService
- Throws:
BackendException
-
convertUnitID2UnitKey
public java.lang.String convertUnitID2UnitKey(java.lang.String unitID) throws BusinessObjectExceptionDescription copied from interface:ConverterConverts the unit ID (examplePCfor en_US) into the unit key (exampleST)- Specified by:
convertUnitID2UnitKeyin interfaceConverter- Parameters:
unitID- language dependent unit ID- Returns:
- unit key
- Throws:
BusinessObjectException
-
convertUnitKey2UnitID
public java.lang.String convertUnitKey2UnitID(java.lang.String unitKey) throws BusinessObjectExceptionDescription copied from interface:ConverterConverts the unit key (exampleST) into the language dependent ID (examplePCfor en_US)- Specified by:
convertUnitKey2UnitIDin interfaceConverter- Parameters:
unitKey- language independent unit key- Returns:
- language dependent unit ID
- Throws:
BusinessObjectException
-
getCurrencyScale
public java.lang.Integer getCurrencyScale(java.lang.String sapCurrencyCode) throws BusinessObjectExceptionDescription copied from interface:ConverterRetrieves the number of decimal places for a currency (which might be an ISO currency but doesn't need to be).
Basis is the ERP/CRM customizing in tables TCURX and TCURC.
Examples: USD typically has 2 decimal places, JPY has zero.- Specified by:
getCurrencyScalein interfaceConverter- Parameters:
sapCurrencyCode- currency code. Must be available in customizing tabke TCURC- Returns:
- number of decimal places
- Throws:
BusinessObjectException
-
getUnitScale
public int getUnitScale(java.lang.String unitKey) throws BusinessObjectExceptionDescription copied from interface:ConverterRetrieves the number of decimal places for units according to ERP/CRM customizing. This is relevant for UI display in case the unit amount is not an integer.- Specified by:
getUnitScalein interfaceConverter- Parameters:
unitKey- the language independet unit key. Must be available in customizing table T006- Returns:
- the number of decimal places for UI display
- Throws:
BusinessObjectException
-
getMinimumScaleValue
public java.math.BigDecimal getMinimumScaleValue(java.lang.String unitKey) throws BusinessObjectException- Specified by:
getMinimumScaleValuein interfaceConverter- Parameters:
unitKey- the language independet unit key. Must be available in customizing table T006- Returns:
- BigDecimal representing the smallest value given a scale
- Throws:
BusinessObjectException
-
getMinimumScaleValue
protected java.math.BigDecimal getMinimumScaleValue(int scale)
-
-