|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.sap.mdm.valuetypes.format.MdmValueFormatter
Utility class supplying methods for formatting MDM values
| Constructor Summary | |
MdmValueFormatter()
|
|
| Method Summary | |
static String |
concatenateDisplayValues(String[] displayVaues)
Concatenates several display values to a single string where the values are separated by ';'. |
static String |
concatenateDisplayValues(String[] displayVaues,
String delimiter)
Concatenates several display values to a single string where the values are separated by the specified delimeter. |
static String[] |
formatAttributeValue(AttributeProperties attr,
MdmValue value,
RegionInheritanceProperties regionInheritance,
int regionalLayer,
DimensionsManager dimensionsManager)
Formats attribute value (or multi-values) based on the attribute properties definitions and regional layer mode. |
static String[] |
formatAttributeValue(AttributeProperties attr,
MdmValue value,
RegionInheritanceProperties regionInheritance,
int regionalLayer,
DimensionsManager dimensionsManager,
String nullString,
String naString)
Formats attribute value (or multi-values) based on the attribute properties definitions and regional layer mode. |
static String[] |
formatAttributeValue(AttributeProperties attr,
MdmValue value,
RegionProperties region,
DimensionsManager dimensionsManager)
Formats attribute value (or multi-values) based on the attribute properties definitions. |
static String[] |
formatAttributeValue(AttributeProperties attr,
MdmValue value,
RegionProperties region,
DimensionsManager dimensionsManager,
String nullString,
String naString)
Formats attribute value (or multi-values) based on the attribute properties definitions. |
static String |
formatCurrency(double value,
MdmCurrencyFormatInfo currencyFormat)
Formats the currency value |
static String |
formatDateTime(Date value,
MdmDateTimeFormatInfo dateTimeFormat)
Formats the date/time value |
static String[] |
formatFieldValue(FieldProperties field,
MdmValue value,
RegionProperties region,
DimensionsManager dimensionsManager)
Formats the field value (or multi-values) based on the field properties definitions. |
static String[] |
formatFieldValue(FieldProperties field,
MdmValue value,
RegionProperties region,
DimensionsManager dimensionsManager,
String nullString,
String naString)
Formats the field value (or multi-values) based on the field properties definitions. |
static String[] |
formatLocalizedAttributeValue(AttributeProperties attr,
MdmValue value,
RegionProperties region,
DimensionsManager dimensionsManager,
Locale formatLocale)
Formats attribute value (or multi-values) based on the attribute properties definitions. |
static String[] |
formatLocalizedFieldValue(FieldProperties field,
MdmValue value,
RegionProperties region,
DimensionsManager dimensionsManager,
Locale formatLocale)
Formats the field value (or multi-values) based on the field properties definitions and format locale. |
static String |
formatMeasurement(double value,
MdmMeasurementFormatInfo measurementFormat,
DimensionsManager dimensionsManager)
Formats the measurement value |
static 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 |
public MdmValueFormatter()
| Method Detail |
public static String[] formatFieldValue(FieldProperties field,
MdmValue value,
RegionProperties region,
DimensionsManager dimensionsManager,
String nullString,
String naString)
throws MdmValueFormatException
field - the field propertiesvalue - the field valueregion - the region properties. If Null, the first region will be used for multi-regional values
and default locale will be used for formattingdimensionsManager - the DimensionsManager instance.
If Null then only build-in dimensions will be used.nullString - the presentation of Null valuenaString - the presentation of N/A value
MdmValueFormatException
public static String[] formatFieldValue(FieldProperties field,
MdmValue value,
RegionProperties region,
DimensionsManager dimensionsManager)
throws MdmValueFormatException
field - the field propertiesvalue - the field valueregion - the region properties. If Null, the first region will be used for multi-regional values
and default locale will be used for formattingdimensionsManager - the DimensionsManager instance.
If Null then only build-in dimensions will be used.
MdmValueFormatException
public static String[] formatAttributeValue(AttributeProperties attr,
MdmValue value,
RegionProperties region,
DimensionsManager dimensionsManager,
String nullString,
String naString)
throws MdmValueFormatException
attr - the attribute propertiesvalue - the attribute valueregion - the region properties. If Null, the first region will be used for multi-regional values
and default locale will be used for formattingdimensionsManager - the DimensionsManager instance.
If Null then only build-in dimensions will be used.nullString - presentation of Null valuenaString - presentation of N/A value
MdmValueFormatException
public static String[] formatAttributeValue(AttributeProperties attr,
MdmValue value,
RegionProperties region,
DimensionsManager dimensionsManager)
throws MdmValueFormatException
attr - the attribute propertiesvalue - the attribute valueregion - the region properties. If Null, the first region will be used for multi-regional values
and default locale will be used for formattingdimensionsManager - the DimensionsManager instance.
If Null then only build-in dimensions will be used.
MdmValueFormatException
public static String formatRealNumber(double number,
MdmNumberFormatInfo numberFormat)
throws MdmValueFormatException
number - the number valuenumberFormat - the number format definition
MdmValueFormatException
public static String formatMeasurement(double value,
MdmMeasurementFormatInfo measurementFormat,
DimensionsManager dimensionsManager)
throws MdmValueFormatException
value - the measurement valuemeasurementFormat - the measurement format definitiondimensionsManager - the DimensionsManager instance.
If Null then only build-in dimensions will be used.
MdmValueFormatException
public static String formatCurrency(double value,
MdmCurrencyFormatInfo currencyFormat)
throws MdmValueFormatException
value - the currency valuecurrencyFormat - the currency format definition
MdmValueFormatException
public static String formatDateTime(Date value,
MdmDateTimeFormatInfo dateTimeFormat)
throws MdmValueFormatException
value - the date/time valuedateTimeFormat - the date/time format definition
MdmValueFormatExceptionpublic static String concatenateDisplayValues(String[] displayVaues)
displayVaues - array of display values that should be concatenated.
public static String concatenateDisplayValues(String[] displayVaues,
String delimiter)
displayVaues - array of display values that should be concatenated.delimiter - the delimeter separated display values
public static String[] formatAttributeValue(AttributeProperties attr,
MdmValue value,
RegionInheritanceProperties regionInheritance,
int regionalLayer,
DimensionsManager dimensionsManager)
throws MdmValueFormatException
attr - the attribute propertiesvalue - the attribute valueregionInheritance - the inheritance of the regions. Used only for text attribute, put null in another case.regionalLayer - regional layer mode. Used only for text attribute, put -1 in another case.
If regionalLayer is CURRENT - current session language text value is returned (empty string if there is no value).
If regionalLayer is PRIMARY_INHERITED - check the value for current session language, if exists return it, else
check the primary inherited languages if exists return it else return empty string. If regionalLayer is INHERITED
check the value for current session language, return the value if exists, else check the text value in primary
inherited languages, return it if exists and if not check the value in secondary inherited languages.dimensionsManager - the DimensionsManager instance.
If Null then only build-in dimensions will be used.
MdmValueFormatExceptionRegionalLayer,
GetRepositoryInheritedRegionListCommand
public static String[] formatAttributeValue(AttributeProperties attr,
MdmValue value,
RegionInheritanceProperties regionInheritance,
int regionalLayer,
DimensionsManager dimensionsManager,
String nullString,
String naString)
throws MdmValueFormatException
attr - the attribute propertiesvalue - the attribute valueregionInheritance - the inheritance of the regions. Used only for text attribute, put null in another case.regionalLayer - regional layer mode. Used only for text attribute, put -1 in another case.
If regionalLayer is CURRENT - current session language text value is returned (empty string if there is no value).
If regionalLayer is PRIMARY_INHERITED - check the value for current session language, if exists return it, else
check the primary inherited languages if exists return it else return empty string. If regionalLayer is INHERITED
check the value for current session language, return the value if exists, else check the text value in primary
inherited languages, return it if exists and if not check the value in secondary inherited languages.dimensionsManager - the DimensionsManager instance. Used only for attribute of NUMERIC_TYPE.
If Null then only build-in dimensions will be used.nullString - presentation of Null valuenaString - presentation of N/A value
MdmValueFormatExceptionRegionalLayer,
GetRepositoryInheritedRegionListCommand
public static String[] formatLocalizedAttributeValue(AttributeProperties attr,
MdmValue value,
RegionProperties region,
DimensionsManager dimensionsManager,
Locale formatLocale)
throws MdmValueFormatException
attr - the attribute propertiesvalue - the attribute valueregion - the region properties. If Null, the first region will be used for multi-regional values
and default locale will be used for formattingdimensionsManager - the DimensionsManager instance.
If Null then only build-in dimensions will be used.formatLocale - format locale parameter is used for formatting the value, in case format locale is null
the formatting is performed using the region parameter. If the region parameter is null also then formatting is
done using the default locale.
MdmValueFormatException
public static String[] formatLocalizedFieldValue(FieldProperties field,
MdmValue value,
RegionProperties region,
DimensionsManager dimensionsManager,
Locale formatLocale)
throws MdmValueFormatException
field - the field propertiesvalue - the field valueregion - the region properties. If Null, the first region will be used for multi-regional valuesdimensionsManager - the DimensionsManager instance.
If Null then only build-in dimensions will be used.formatLocale - format locale parameter is used for formatting the value, in case format locale is null
the formatting is performed using the region parameter. If the region parameter is null also then formatting is
done using the default locale.
MdmValueFormatException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
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.