|
Web Dynpro API Documentation | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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
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 |
public static final java.lang.String DEFAULT_DATE_PATTERN
public static final int DEFAULT_DATETIMESTYLE
public static final int DATETIME_STYLE_SHORT
public static final int DATETIME_STYLE_MEDIUM
public static final int DATETIME_STYLE_LONG
public static final int DATETIME_STYLE_FULL
public static final int DATETIME_STYLE_NONE
public static final int DEFAULT_CURRENCY_MINFRACTIONDIGITS
public static final int DEFAULT_CURRENCY_MAXFRACTIONDIGITS
public static final int DEFAULT_CURRENCY_MININTEGERDIGITS
public static final int DEFAULT_CURRENCY_MAXINTEGERDIGITS
public static final int DEFAULT_NUMBER_MINFRACTIONDIGITS
public static final int DEFAULT_NUMBER_MAXFRACTIONDIGITS
public static final int DEFAULT_NUMBER_MININTEGERDIGITS
public static final int DEFAULT_NUMBER_MAXINTEGERDIGITS
public static final int DEFAULT_PERCENT_MINFRACTIONDIGITS
public static final int DEFAULT_PERCENT_MAXFRACTIONDIGITS
public static final int DEFAULT_PERCENT_MININTEGERDIGITS
public static final int DEFAULT_PERCENT_MAXINTEGERDIGITS
| Method Detail |
public void init(java.util.Locale locale,
java.util.TimeZone timezone)
locale - locale of this resource handlertimezone - timezone of this resource handler; if null,
the default time zone for the specified locale is taken.public java.util.TimeZone getTimezone()
public java.util.Locale getLocale()
public void loadResourceBundle(java.lang.String resourceBundleName,
java.lang.ClassLoader loader)
throws java.util.MissingResourceException
resourceBundleName using
the classloader supplied as input parameter.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 nullloader - classloader used to load the resource bundle; if set to
null the default classloader is usedjava.util.MissingResourceException - if the specified resource bundle couldn't be loaded
public void loadResourceBundle(java.lang.String resourceBundleName)
throws java.util.MissingResourceException
resourceBundleName using
the default classloader of the virtual machine.resourceBundleName - the name of the resource bundle that should be loaded;
must not be nulljava.util.MissingResourceException - if the specified resource bundle couldn't be loaded
public java.util.ResourceBundle getResourceBundle(java.lang.String resourceBundleName)
throws java.util.MissingResourceException
resourceBundleName using
the default classloader of the virtual machine and returns the loaded resource bundle.resourceBundleName - the name of the resource bundle that should be loaded;
must not be nulljava.util.MissingResourceException - if the specified resource bundle couldn't be loaded
public java.util.ResourceBundle getResourceBundle(java.lang.String resourceBundleName,
java.lang.ClassLoader loader)
throws java.util.MissingResourceException
resourceBundleName using
the classloader supplied as input parameter and returns the loaded resource bundle.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 nullloader - classloader used to load the resource bundle; if set to
null the default classloader is usedjava.util.MissingResourceException - if the specified resource bundle couldn't be loadedpublic java.lang.String getString(java.lang.String key)
key - the key of the searched NLS stringkey is returnedpublic java.util.Enumeration getKeys()
null is returned.
public java.lang.String getFormattedString(java.lang.String key,
java.lang.Object[] args)
key - the key of the searched NLS stringargs - the message arguments according to java.text.MessageFormatkey
is returnedpublic void setDateFormat(java.lang.String pattern)
pattern - date pattern
public void setDateFormat(int dateStyle,
int timeStyle)
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 interfacepublic java.lang.String formatDate(long date)
date - date to be formattedpublic java.lang.String formatDate(java.util.Date date)
date - date to be formatted
public void setCurrencyFormat(int minFractionDigits,
int maxFractionDigits,
int minIntegerDigits,
int maxIntegerDigits)
minFractionDigits - minimum number of digits for fraction part of numbermaxFractionDigits - maximum number of digits for fraction part of numberminIntegerDigits - minimum number of digits for integer part of numbermaxIntegerDigits - maximum number of digits for integer part of numberpublic java.lang.String formatCurrency(long currency)
currency - currency to be formattedpublic java.lang.String formatCurrency(java.lang.Number currency)
currency - currency to be formatted
public void setNumberFormat(int minFractionDigits,
int maxFractionDigits,
int minIntegerDigits,
int maxIntegerDigits)
minFractionDigits - minimum number of digits for fraction part of numbermaxFractionDigits - maximum number of digits for fraction part of numberminIntegerDigits - minimum number of digits for integer part of numbermaxIntegerDigits - maximum number of digits for integer part of numberpublic java.lang.String formatNumber(long number)
number - number to be formattedpublic java.lang.String formatNumber(java.lang.Number number)
number - number to be formatted
public void setPercentageFormat(int minFractionDigits,
int maxFractionDigits,
int minIntegerDigits,
int maxIntegerDigits)
minFractionDigits - minimum number of digits for fraction part of numbermaxFractionDigits - maximum number of digits for fraction part of numberminIntegerDigits - minimum number of digits for integer part of numbermaxIntegerDigits - maximum number of digits for integer part of numberpublic java.lang.String formatPercentage(long percent)
percent - percent to be formattedpublic java.lang.String formatPercentage(java.lang.Number percent)
percent - percent to be formatted
|
Web Dynpro API Documentation | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||