com.sap.mdm.valuetypes.format
Class MdmValueFormatter

java.lang.Object
  extended bycom.sap.mdm.valuetypes.format.MdmValueFormatter

public class MdmValueFormatter
extends java.lang.Object

Utility class supplying methods for formatting MDM values


Constructor Summary
MdmValueFormatter()
           
 
Method Summary
static java.lang.String concatenateDisplayValues(java.lang.String[] displayVaues)
          Concatenates several display values to a single string where the values are separated by ';'.
static java.lang.String concatenateDisplayValues(java.lang.String[] displayVaues, java.lang.String delimiter)
          Concatenates several display values to a single string where the values are separated by the specified delimeter.
static java.lang.String[] formatAttributeValue(AttributeProperties attr, MdmValue value, RegionProperties region, DimensionsManager dimensionsManager)
          Formats attribute value (or multi-values) based on the attribute properties definitions.
static java.lang.String[] formatAttributeValue(AttributeProperties attr, MdmValue value, RegionProperties region, DimensionsManager dimensionsManager, java.lang.String nullString, java.lang.String naString)
          Formats attribute value (or multi-values) based on the attribute properties definitions.
static java.lang.String formatCurrency(double value, MdmCurrencyFormatInfo currencyFormat)
          Formats the currency value
static java.lang.String formatDateTime(java.util.Date value, MdmDateTimeFormatInfo dateTimeFormat)
          Formats the date/time value
static java.lang.String[] formatFieldValue(FieldProperties field, MdmValue value, RegionProperties region, DimensionsManager dimensionsManager)
          Formats the field value (or multi-values) based on the field properties definitions.
static java.lang.String[] formatFieldValue(FieldProperties field, MdmValue value, RegionProperties region, DimensionsManager dimensionsManager, java.lang.String nullString, java.lang.String naString)
          Formats the field value (or multi-values) based on the field properties definitions.
static java.lang.String formatMeasurement(double value, MdmMeasurementFormatInfo measurementFormat, DimensionsManager dimensionsManager)
          Formats the measurement value
static java.lang.String formatRealNumber(double number, MdmNumberFormatInfo numberFormat)
          Formats the number value
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MdmValueFormatter

public MdmValueFormatter()
Method Detail

formatFieldValue

public static java.lang.String[] formatFieldValue(FieldProperties field,
                                                  MdmValue value,
                                                  RegionProperties region,
                                                  DimensionsManager dimensionsManager,
                                                  java.lang.String nullString,
                                                  java.lang.String naString)
                                           throws MdmValueFormatException
Formats the field value (or multi-values) based on the field properties definitions.

Parameters:
field - the field properties
value - the field value
region - the region properties. If Null, the first region will be used for multi-regional values and default locale will be used for formatting
dimensionsManager - the DimensionsManager instance. If Null then only build-in dimensions will be used.
nullString - the presentation of Null value
naString - the presentation of N/A value
Returns:
array of formatted values
Throws:
MdmValueFormatException

formatFieldValue

public static java.lang.String[] formatFieldValue(FieldProperties field,
                                                  MdmValue value,
                                                  RegionProperties region,
                                                  DimensionsManager dimensionsManager)
                                           throws MdmValueFormatException
Formats the field value (or multi-values) based on the field properties definitions.

Parameters:
field - the field properties
value - the field value
region - the region properties. If Null, the first region will be used for multi-regional values and default locale will be used for formatting
dimensionsManager - the DimensionsManager instance. If Null then only build-in dimensions will be used.
Returns:
array of formatted values
Throws:
MdmValueFormatException

formatAttributeValue

public static java.lang.String[] formatAttributeValue(AttributeProperties attr,
                                                      MdmValue value,
                                                      RegionProperties region,
                                                      DimensionsManager dimensionsManager,
                                                      java.lang.String nullString,
                                                      java.lang.String naString)
                                               throws MdmValueFormatException
Formats attribute value (or multi-values) based on the attribute properties definitions.

Parameters:
attr - the attribute properties
value - the attribute value
region - the region properties. If Null, the first region will be used for multi-regional values and default locale will be used for formatting
dimensionsManager - the DimensionsManager instance. If Null then only build-in dimensions will be used.
nullString - presentation of Null value
naString - presentation of N/A value
Returns:
array of formatted values
Throws:
MdmValueFormatException

formatAttributeValue

public static java.lang.String[] formatAttributeValue(AttributeProperties attr,
                                                      MdmValue value,
                                                      RegionProperties region,
                                                      DimensionsManager dimensionsManager)
                                               throws MdmValueFormatException
Formats attribute value (or multi-values) based on the attribute properties definitions.

Parameters:
attr - the attribute properties
value - the attribute value
region - the region properties. If Null, the first region will be used for multi-regional values and default locale will be used for formatting
dimensionsManager - the DimensionsManager instance. If Null then only build-in dimensions will be used.
Returns:
array of formatted values
Throws:
MdmValueFormatException

formatRealNumber

public static java.lang.String formatRealNumber(double number,
                                                MdmNumberFormatInfo numberFormat)
                                         throws MdmValueFormatException
Formats the number value

Parameters:
number - the number value
numberFormat - the number format definition
Returns:
formatted value
Throws:
MdmValueFormatException

formatMeasurement

public static java.lang.String formatMeasurement(double value,
                                                 MdmMeasurementFormatInfo measurementFormat,
                                                 DimensionsManager dimensionsManager)
                                          throws MdmValueFormatException
Formats the measurement value

Parameters:
value - the measurement value
measurementFormat - the measurement format definition
dimensionsManager - the DimensionsManager instance. If Null then only build-in dimensions will be used.
Returns:
formatted value
Throws:
MdmValueFormatException

formatCurrency

public static java.lang.String formatCurrency(double value,
                                              MdmCurrencyFormatInfo currencyFormat)
                                       throws MdmValueFormatException
Formats the currency value

Parameters:
value - the currency value
currencyFormat - the currency format definition
Returns:
formatted value
Throws:
MdmValueFormatException

formatDateTime

public static java.lang.String formatDateTime(java.util.Date value,
                                              MdmDateTimeFormatInfo dateTimeFormat)
                                       throws MdmValueFormatException
Formats the date/time value

Parameters:
value - the date/time value
dateTimeFormat - the date/time format definition
Returns:
formatted value
Throws:
MdmValueFormatException

concatenateDisplayValues

public static java.lang.String concatenateDisplayValues(java.lang.String[] displayVaues)
Concatenates several display values to a single string where the values are separated by ';'.

Parameters:
displayVaues - array of display values that should be concatenated.
Returns:
concatenated string

concatenateDisplayValues

public static java.lang.String concatenateDisplayValues(java.lang.String[] displayVaues,
                                                        java.lang.String delimiter)
Concatenates several display values to a single string where the values are separated by the specified delimeter.

Parameters:
displayVaues - array of display values that should be concatenated.
delimiter - the delimeter separated display values
Returns:
concatenated string


Copyright 2004-2007 by SAP AG. All Rights Reserved.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies (SAP Group) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.