Web Dynpro API Documentation

com.sap.tc.webdynpro.services.sal.localization.api
Interface IWDResourceHandler

All Superinterfaces:
IWDService

public interface IWDResourceHandler
extends IWDService

IWDResourceHandler represents a handler for locale specific resources. A resource handler is associated to a specified locale and optionally to a certain time zone. A resource handler is responsible for

See Also:
com.sap.tc.webdynpro.services.sal.core.IResourceHandlerFactory

Field Summary
static int DATETIME_STYLE_FULL
          Style for date and time.
static int DATETIME_STYLE_LONG
          Style for date and time.
static int DATETIME_STYLE_MEDIUM
          Style for date and time.
static int DATETIME_STYLE_NONE
          Style for date and time.
static int DATETIME_STYLE_SHORT
          Style for date and time.
static int DEFAULT_CURRENCY_MAXFRACTIONDIGITS
          Maximum number of digits for currency amounts.
static int DEFAULT_CURRENCY_MAXINTEGERDIGITS
          Maximum number of digits for currency amounts (integer).
static int DEFAULT_CURRENCY_MINFRACTIONDIGITS
          Minimum number of digits for currency amounts.
static int DEFAULT_CURRENCY_MININTEGERDIGITS
          Minimum number of digits for currency amounts (integer).
static java.lang.String DEFAULT_DATE_PATTERN
          Pattern for date.
static int DEFAULT_DATETIMESTYLE
          Style for date and time.
static int DEFAULT_NUMBER_MAXFRACTIONDIGITS
          Maximum number of digits for numbers.
static int DEFAULT_NUMBER_MAXINTEGERDIGITS
          Maximum number of digits for integer numbers.
static int DEFAULT_NUMBER_MINFRACTIONDIGITS
          Minimum number of digits for numbers.
static int DEFAULT_NUMBER_MININTEGERDIGITS
          Minimum number of digits for integer numbers.
static int DEFAULT_PERCENT_MAXFRACTIONDIGITS
          Maximum number of digits for percentages.
static int DEFAULT_PERCENT_MAXINTEGERDIGITS
          Maximum number of digits for integer percentages.
static int DEFAULT_PERCENT_MINFRACTIONDIGITS
          Minimum number of digits for percentages.
static int DEFAULT_PERCENT_MININTEGERDIGITS
          Minimum number of digits for integer percentages.
 
Method Summary
 java.lang.String formatCurrency(long currency)
          Formats currency according to locale using the set format.
 java.lang.String formatCurrency(java.lang.Number currency)
          Formats currency according to locale using the set format.
 java.lang.String formatDate(java.util.Date date)
          Formats date according to locale/timezone using the set pattern/style.
 java.lang.String formatDate(long date)
          Formats date according to locale/timezone using the set pattern/style.
 java.lang.String formatNumber(long number)
          Formats number according to locale using the set format.
 java.lang.String formatNumber(java.lang.Number number)
          Formats number according to locale using the set format.
 java.lang.String formatPercentage(long percent)
          Formats percentage according to locale using the set format.
 java.lang.String formatPercentage(java.lang.Number percent)
          Formats percentage according to locale using the set format.
 java.lang.String getFormattedString(java.lang.String key, java.lang.Object[] args)
          Return is the message identified by key using the set resource bundle and inserted arguments according to java.text.MessageFormat specification.
 java.util.Enumeration getKeys()
          Returns an enumeration of all keys.
 java.util.Locale getLocale()
          Return is the locale used for this resource handler.
 java.util.ResourceBundle getResourceBundle(java.lang.String resourceBundleName)
          Loads the resource bundle specified by resourceBundleName using the default classloader of the virtual machine and returns the loaded resource bundle.
 java.util.ResourceBundle getResourceBundle(java.lang.String resourceBundleName, java.lang.ClassLoader loader)
          Loads the resource bundle specified by resourceBundleName using the classloader supplied as input parameter and returns the loaded resource bundle.
 java.lang.String getString(java.lang.String key)
          Return is the translated string found in the loaded resource bundle, if an entry with the given key exists.
 java.util.TimeZone getTimezone()
          Return is the time zone of this resource handler.
 void init(java.util.Locale locale, java.util.TimeZone timezone)
          Initializes the resource handler with the specified locale and time zone.
 void loadResourceBundle(java.lang.String resourceBundleName)
          Loads the resource bundle specified by resourceBundleName using the default classloader of the virtual machine.
 void loadResourceBundle(java.lang.String resourceBundleName, java.lang.ClassLoader loader)
          Loads the resource bundle specified by resourceBundleName using the classloader supplied as input parameter.
 void setCurrencyFormat(int minFractionDigits, int maxFractionDigits, int minIntegerDigits, int maxIntegerDigits)
          Sets the currency format to be used for formatting format-unspecified currencies.
 void setDateFormat(int dateStyle, int timeStyle)
          Sets date format (see documentation on DateFormat) to be used for formatting format-unspecified dates.
 void setDateFormat(java.lang.String pattern)
          Sets date format (see documentation on SimpleDateFormat) to be used for formatting format-unspecified dates.
 void setNumberFormat(int minFractionDigits, int maxFractionDigits, int minIntegerDigits, int maxIntegerDigits)
          Sets the number format to be used for formatting format-unspecified numbers.
 void setPercentageFormat(int minFractionDigits, int maxFractionDigits, int minIntegerDigits, int maxIntegerDigits)
          Sets percentage format to be used for formatting format-unspecified percents.
 
Methods inherited from interface com.sap.tc.webdynpro.services.sal.api.IWDService
getDescription, getServiceName, getVersion
 

Field Detail

DEFAULT_DATE_PATTERN

public static final java.lang.String DEFAULT_DATE_PATTERN
Pattern for date.

DEFAULT_DATETIMESTYLE

public static final int DEFAULT_DATETIMESTYLE
Style for date and time.

DATETIME_STYLE_SHORT

public static final int DATETIME_STYLE_SHORT
Style for date and time.

DATETIME_STYLE_MEDIUM

public static final int DATETIME_STYLE_MEDIUM
Style for date and time.

DATETIME_STYLE_LONG

public static final int DATETIME_STYLE_LONG
Style for date and time.

DATETIME_STYLE_FULL

public static final int DATETIME_STYLE_FULL
Style for date and time.

DATETIME_STYLE_NONE

public static final int DATETIME_STYLE_NONE
Style for date and time.

DEFAULT_CURRENCY_MINFRACTIONDIGITS

public static final int DEFAULT_CURRENCY_MINFRACTIONDIGITS
Minimum number of digits for currency amounts.

DEFAULT_CURRENCY_MAXFRACTIONDIGITS

public static final int DEFAULT_CURRENCY_MAXFRACTIONDIGITS
Maximum number of digits for currency amounts.

DEFAULT_CURRENCY_MININTEGERDIGITS

public static final int DEFAULT_CURRENCY_MININTEGERDIGITS
Minimum number of digits for currency amounts (integer).

DEFAULT_CURRENCY_MAXINTEGERDIGITS

public static final int DEFAULT_CURRENCY_MAXINTEGERDIGITS
Maximum number of digits for currency amounts (integer).

DEFAULT_NUMBER_MINFRACTIONDIGITS

public static final int DEFAULT_NUMBER_MINFRACTIONDIGITS
Minimum number of digits for numbers.

DEFAULT_NUMBER_MAXFRACTIONDIGITS

public static final int DEFAULT_NUMBER_MAXFRACTIONDIGITS
Maximum number of digits for numbers.

DEFAULT_NUMBER_MININTEGERDIGITS

public static final int DEFAULT_NUMBER_MININTEGERDIGITS
Minimum number of digits for integer numbers.

DEFAULT_NUMBER_MAXINTEGERDIGITS

public static final int DEFAULT_NUMBER_MAXINTEGERDIGITS
Maximum number of digits for integer numbers.

DEFAULT_PERCENT_MINFRACTIONDIGITS

public static final int DEFAULT_PERCENT_MINFRACTIONDIGITS
Minimum number of digits for percentages.

DEFAULT_PERCENT_MAXFRACTIONDIGITS

public static final int DEFAULT_PERCENT_MAXFRACTIONDIGITS
Maximum number of digits for percentages.

DEFAULT_PERCENT_MININTEGERDIGITS

public static final int DEFAULT_PERCENT_MININTEGERDIGITS
Minimum number of digits for integer percentages.

DEFAULT_PERCENT_MAXINTEGERDIGITS

public static final int DEFAULT_PERCENT_MAXINTEGERDIGITS
Maximum number of digits for integer percentages.
Method Detail

init

public void init(java.util.Locale locale,
                 java.util.TimeZone timezone)
Initializes the resource handler with the specified locale and time zone.
Parameters:
locale - locale of this resource handler
timezone - timezone of this resource handler; if null, the default time zone for the specified locale is taken.

getTimezone

public java.util.TimeZone getTimezone()
Return is the time zone of this resource handler.
Returns:
the time zone of this resource handler

getLocale

public java.util.Locale getLocale()
Return is the locale used for this resource handler.
Returns:
the actually used locale

loadResourceBundle

public void loadResourceBundle(java.lang.String resourceBundleName,
                               java.lang.ClassLoader loader)
                        throws java.util.MissingResourceException
Loads the resource bundle specified by resourceBundleName using the classloader supplied as input parameter.
Parameters:
resourceBundleName - base name of the resource bundle that should be loaded; the resource bundle can be a java.utl.ListResourceBundle or a java.util.PropertyResourceBundle; this parameter must not be null
loader - classloader used to load the resource bundle; if set to null the default classloader is used
Throws:
java.util.MissingResourceException - if the specified resource bundle couldn't be loaded

loadResourceBundle

public void loadResourceBundle(java.lang.String resourceBundleName)
                        throws java.util.MissingResourceException
Loads the resource bundle specified by resourceBundleName using the default classloader of the virtual machine.
Parameters:
resourceBundleName - the name of the resource bundle that should be loaded; must not be null
Throws:
java.util.MissingResourceException - if the specified resource bundle couldn't be loaded

getResourceBundle

public java.util.ResourceBundle getResourceBundle(java.lang.String resourceBundleName)
                                           throws java.util.MissingResourceException
Loads the resource bundle specified by resourceBundleName using the default classloader of the virtual machine and returns the loaded resource bundle.
Parameters:
resourceBundleName - the name of the resource bundle that should be loaded; must not be null
Returns:
the loaded resource bundle
Throws:
java.util.MissingResourceException - if the specified resource bundle couldn't be loaded

getResourceBundle

public java.util.ResourceBundle getResourceBundle(java.lang.String resourceBundleName,
                                                  java.lang.ClassLoader loader)
                                           throws java.util.MissingResourceException
Loads the resource bundle specified by resourceBundleName using the classloader supplied as input parameter and returns the loaded resource bundle.
Parameters:
resourceBundleName - base name of the resource bundle that should be loaded; the resource bundle can be a java.utl.ListResourceBundle or a java.util.PropertyResourceBundle; this parameter must not be null
loader - classloader used to load the resource bundle; if set to null the default classloader is used
Returns:
the loaded resource bundle
Throws:
java.util.MissingResourceException - if the specified resource bundle couldn't be loaded

getString

public java.lang.String getString(java.lang.String key)
Return is the translated string found in the loaded resource bundle, if an entry with the given key exists. Otherwise the supplied key parameter is returned.
Parameters:
key - the key of the searched NLS string
Returns:
the translated string, if existing; otherwise key is returned

getKeys

public java.util.Enumeration getKeys()
Returns an enumeration of all keys. If no resource bundle is loaded yet, null is returned.
Returns:
an enumeration of all keys

getFormattedString

public java.lang.String getFormattedString(java.lang.String key,
                                           java.lang.Object[] args)
Return is the message identified by key using the set resource bundle and inserted arguments according to java.text.MessageFormat specification.
Parameters:
key - the key of the searched NLS string
args - the message arguments according to java.text.MessageFormat
Returns:
the translated, formatted string, if existing; otherwise key is returned

setDateFormat

public void setDateFormat(java.lang.String pattern)
Sets date format (see documentation on SimpleDateFormat) to be used for formatting format-unspecified dates.
Parameters:
pattern - date pattern

setDateFormat

public void setDateFormat(int dateStyle,
                          int timeStyle)
Sets date format (see documentation on DateFormat) to be used for formatting format-unspecified dates.
Parameters:
dateStyle - date formatting style; possible values are DATETIME_STYLE_XXX constants defined in this interface.
timeStyle - time formatting style; possible values are DATETIME_STYLE_XXX constants defined in this interface

formatDate

public java.lang.String formatDate(long date)
Formats date according to locale/timezone using the set pattern/style.
Parameters:
date - date to be formatted
Returns:
formatted date

formatDate

public java.lang.String formatDate(java.util.Date date)
Formats date according to locale/timezone using the set pattern/style.
Parameters:
date - date to be formatted
Returns:
formatted date

setCurrencyFormat

public void setCurrencyFormat(int minFractionDigits,
                              int maxFractionDigits,
                              int minIntegerDigits,
                              int maxIntegerDigits)
Sets the currency format to be used for formatting format-unspecified currencies.
Parameters:
minFractionDigits - minimum number of digits for fraction part of number
maxFractionDigits - maximum number of digits for fraction part of number
minIntegerDigits - minimum number of digits for integer part of number
maxIntegerDigits - maximum number of digits for integer part of number

formatCurrency

public java.lang.String formatCurrency(long currency)
Formats currency according to locale using the set format.
Parameters:
currency - currency to be formatted
Returns:
formatted currency

formatCurrency

public java.lang.String formatCurrency(java.lang.Number currency)
Formats currency according to locale using the set format.
Parameters:
currency - currency to be formatted
Returns:
formatted currency

setNumberFormat

public void setNumberFormat(int minFractionDigits,
                            int maxFractionDigits,
                            int minIntegerDigits,
                            int maxIntegerDigits)
Sets the number format to be used for formatting format-unspecified numbers.
Parameters:
minFractionDigits - minimum number of digits for fraction part of number
maxFractionDigits - maximum number of digits for fraction part of number
minIntegerDigits - minimum number of digits for integer part of number
maxIntegerDigits - maximum number of digits for integer part of number

formatNumber

public java.lang.String formatNumber(long number)
Formats number according to locale using the set format.
Parameters:
number - number to be formatted
Returns:
formatted number

formatNumber

public java.lang.String formatNumber(java.lang.Number number)
Formats number according to locale using the set format.
Parameters:
number - number to be formatted
Returns:
formatted number

setPercentageFormat

public void setPercentageFormat(int minFractionDigits,
                                int maxFractionDigits,
                                int minIntegerDigits,
                                int maxIntegerDigits)
Sets percentage format to be used for formatting format-unspecified percents.
Parameters:
minFractionDigits - minimum number of digits for fraction part of number
maxFractionDigits - maximum number of digits for fraction part of number
minIntegerDigits - minimum number of digits for integer part of number
maxIntegerDigits - maximum number of digits for integer part of number

formatPercentage

public java.lang.String formatPercentage(long percent)
Formats percentage according to locale using the set format.
Parameters:
percent - percent to be formatted
Returns:
formatted percent

formatPercentage

public java.lang.String formatPercentage(java.lang.Number percent)
Formats percentage according to locale using the set format.
Parameters:
percent - percent to be formatted
Returns:
formatted percent

Web Dynpro API Documentation

Copyright © 2004 SAP AG. Automatically generated Thu Mar 3 2005, 22:15