|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectblackboard.data.BbObject
blackboard.platform.intl.BbLocale
public class BbLocale
This class represents a particular application locale setting. It provides
methods to format data (date, times, names, etc.) according to the preferences
configured for the locale. Using getLocaleObject() it can also be
used with any Java objects/methods which require a Locale object.
| Nested Class Summary | |
|---|---|
static class |
BbLocale.Date
Date |
static class |
BbLocale.Name
Name |
static class |
BbLocale.Time
Time |
| Field Summary | |
|---|---|
static DataType |
DATA_TYPE
Object data type constant used in brokering loaders and persisters |
static java.lang.String |
RESOURCE_BUNDLE
Resource bundle for this data object |
| Fields inherited from class blackboard.data.BbObject |
|---|
_bbAttributes |
| Constructor Summary | |
|---|---|
BbLocale()
Creates an instance of Course with default property values. |
|
| Method Summary | |
|---|---|
java.lang.String |
formatCurrency(double currency)
Formats a double as a currency value according to the current locale and returns it as a String. |
java.lang.String |
formatDate(java.util.Date date)
Formats a date (not including time portion) according to the current locale and the default date style and returns it as a string. |
java.lang.String |
formatDate(java.util.Date date,
BbLocale.Date dateStyle)
Formats a date (not including time portion) according to the current locale and given date style and returns it as a string. |
java.lang.String |
formatDateTime(java.util.Date dateTime)
Formats a date/time according to the current locale and the default date and time styles and returns it as a string. |
java.lang.String |
formatDateTime(java.util.Date dateTime,
BbLocale.Date dateStyle,
BbLocale.Time timeStyle)
Formats a date/time according to the current locale and the given date and time styles and returns it as a string. |
java.lang.String |
formatDuration(long duration)
Format a time duration (in milliseconds) as a string, broken down by days, hours, minutes, seconds and milliseconds. |
java.lang.String |
formatName(java.lang.String strGivenName,
java.lang.String strMiddleName,
java.lang.String strFamilyName,
java.lang.String strTitle,
BbLocale.Name nameStyle)
Formats a name according to the current locale and given BbLocale.Name
style and returns it as a string. |
java.lang.String |
formatName(User user,
BbLocale.Name nameStyle)
Formats the name of the given user according to the current locale and given BbLocale.Name style and returns it as a string. |
java.lang.String |
formatNumber(double num)
Formats a number according to the current locale and returns it as a String. |
java.lang.String |
formatPercent(double percent)
Formats a double as a percentage according to the current locale and returns it as a String. |
java.lang.String |
formatTime(java.util.Date time)
Formats the time portion of a date according to the current locale and the default time style and returns it as a string. |
java.lang.String |
formatTime(java.util.Date time,
BbLocale.Time timeStyle)
Formats the time portion of a date according to the current locale and given time style and returns it as a string. |
java.lang.String |
getAlias()
Returns the locale alias string for this locale object. |
java.lang.String |
getBbVersion()
Returns the Bb Version for this locale object |
DataType |
getDataType()
Returns the DataType identifier for this object. |
boolean |
getIsAvailable()
Returns the availability flag for this BbLocale. |
boolean |
getIsCourseEnabled()
Returns the availability flag for this BbLocale in a course context. |
boolean |
getIsDefault()
Returns the is_default flag for this BbLocale. |
java.lang.Boolean |
getIsEditable()
getIsEditable |
boolean |
getIsLeftToRight()
Returns the is_left_to_right flag for this BbLocale. |
boolean |
getIsOrganizationEnabled()
Returns the availability flag for this BbLocale in a organization context. |
boolean |
getIsUserEnabled()
Returns the availability flag for this BbLocale in a user context. |
java.lang.String |
getLocale()
Returns the locale name string for this locale object. |
java.util.Locale |
getLocaleObject()
Returns a Java Locale object that represents the same language and
country settings of this locale. |
java.lang.String |
getLongNameFormat()
Returns the long name string for this locale object. |
java.lang.String |
getName()
Returns the name string for this locale object. |
java.text.NumberFormat |
getNumberFormat()
Returns a cloned instance of the current locale-specific NumberFormat. |
java.text.NumberFormat |
getPercentFormat()
Returns a cloned instance of the current locale-specific percentage formatter. |
java.lang.String |
getPersistentAlias()
Returns the persistent locale alias string for this locale object. |
java.lang.String |
getPersistentName()
Returns the persistent name string for this locale object. |
java.lang.String |
getShortNameFormat()
Returns the short name string for this locale object. |
java.lang.String |
getVendorDescription()
Returns the vendor's description. |
java.lang.String |
getVendorId()
Returns the vendor id associated with the plug-in. |
java.lang.String |
getVendorName()
Returns the user-friendly name of the locale vendor. |
java.lang.String |
getVendorURL()
Returns the URL for the vendor supplying the system extension. |
Version |
getVersion()
Returns the version of this locale |
double |
parseNumber(java.lang.String str)
Accepts a string representation for a number and parses according to the current locale. |
float |
parseNumberAsFloat(java.lang.String str)
Accepts a string representation for a number and parses according to the current locale. |
void |
setAlias(java.lang.String strAlias)
Sets the locale alias string for this locale object. |
void |
setBbVersion(java.lang.String strBbVersion)
Sets the BbVersion string for this locale object |
void |
setIsAvailable(boolean bIsAvailable)
Sets the availability flag for this BbLocale. |
void |
setIsCourseEnabled(boolean bIsAvailable)
Sets the availability flag for this BbLocale in a course context. |
void |
setIsDefault(boolean bIsDefault)
Sets the is_default flag for this BbLocale. |
void |
setIsEditable(boolean b)
setIsEditable |
void |
setIsLeftToRight(boolean bIsLeftToRight)
Sets the is_left_to_right flag for this BbLocale. |
void |
setIsOrganizationEnabled(boolean bIsAvailable)
Sets the availability flag for this BbLocale in a organization context. |
void |
setIsUserEnabled(boolean bIsAvailable)
Sets the availability flag for this BbLocale in a user context. |
void |
setLocale(java.lang.String strLocaleName)
Sets the locale name string for this locale object. |
void |
setLongNameFormat(java.lang.String strName)
Sets the long name string for this locale object. |
void |
setName(java.lang.String strName)
Sets the name string for this locale object. |
void |
setShortNameFormat(java.lang.String strName)
Sets the short name string for this locale object. |
void |
setVendorDescription(java.lang.String dscr)
Sets the vendor description |
void |
setVendorId(java.lang.String vid)
Sets the vendor id associated with this locale. |
void |
setVendorName(java.lang.String vendorName)
Sets the user-friendly vendor name. |
void |
setVendorURL(java.lang.String url)
Used during installation to set the extension vendor's URL. |
void |
setVersion(Version v)
Sets the version for this locale. |
| Methods inherited from class blackboard.data.BbObject |
|---|
clone, getBbAttributes, getCreatedDate, getId, getModifiedDate, persist, setCreatedDate, setId, setModifiedDate, toString, validate |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final DataType DATA_TYPE
public static final java.lang.String RESOURCE_BUNDLE
| Constructor Detail |
|---|
public BbLocale()
Course with default property values.
| Method Detail |
|---|
public DataType getDataType()
DataType identifier for this object. Can be used to
uniquely identify the "type" of this data object.
getDataType in interface IBbObjectgetDataType in interface IdentifiablegetDataType in class BbObjectDataType for this objectpublic java.util.Locale getLocaleObject()
Locale object that represents the same language and
country settings of this locale.
Locale representing the same language and country
settings of this locale.public java.lang.String getPersistentName()
Stringpublic java.lang.String getName()
Stringpublic void setName(java.lang.String strName)
public java.lang.String getBbVersion()
public void setBbVersion(java.lang.String strBbVersion)
strBbVersion - voidpublic java.lang.String getShortNameFormat()
Stringpublic void setShortNameFormat(java.lang.String strName)
public java.lang.String getLongNameFormat()
Stringpublic void setLongNameFormat(java.lang.String strName)
public java.lang.String getLocale()
String of the form language_Country (i.e., "en_US")public void setLocale(java.lang.String strLocaleName)
public java.lang.String getPersistentAlias()
Stringpublic java.lang.String getAlias()
Stringpublic void setAlias(java.lang.String strAlias)
public boolean getIsAvailable()
BbLocale. If a locale is
marked as not available, no one can access it.
getIsAvailable in interface AvailableBbLocale is availablepublic void setIsAvailable(boolean bIsAvailable)
BbLocale. If a locale is
marked as not available, no one can access it.
setIsAvailable in interface AvailablebIsAvailable - true if the locale is to be made available, false otherwise.public boolean getIsDefault()
BbLocale. Only one locale can be honored as the default.
BbLocale is the defaultpublic void setIsDefault(boolean bIsDefault)
BbLocale. Only one locale can be honored as the default.
bIsDefault - true if the locale is to be made the default, false otherwise.public boolean getIsLeftToRight()
BbLocale.
BbLocale is rendered left-to-right.public void setIsLeftToRight(boolean bIsLeftToRight)
BbLocale.
bIsLeftToRight - true if the locale is to be rendered left-to-right.public boolean getIsCourseEnabled()
BbLocale in a course context.
BbLocale is available in a course context.public void setIsCourseEnabled(boolean bIsAvailable)
BbLocale in a course context.
bIsAvailable - true if the locale is to be made available for a course.public boolean getIsOrganizationEnabled()
BbLocale in a organization context.
BbLocale is available in a organization context.public void setIsOrganizationEnabled(boolean bIsAvailable)
BbLocale in a organization context.
bIsAvailable - true if the locale is to be made available for a organization.public boolean getIsUserEnabled()
BbLocale in a user context.
BbLocale is available in a user context.public void setIsUserEnabled(boolean bIsAvailable)
BbLocale in a user context.
bIsAvailable - true if the locale is to be made available for a user.public java.text.NumberFormat getNumberFormat()
setMaximumFractionDigits()
public java.text.NumberFormat getPercentFormat()
setMaximumFractionDigits()
public java.lang.String formatNumber(double num)
num - a double representing the value to be formatted
public double parseNumber(java.lang.String str)
throws java.lang.NumberFormatException
java.text.NumberFormat, and thus
will follow the parsing rules defined by that class.
str - Locale-dependent number string (e.g., "4.0" or "4,0").
java.lang.NumberFormatException - thrown if the number cannot be parsed in the current locale
public float parseNumberAsFloat(java.lang.String str)
throws java.lang.NumberFormatException
java.text.NumberFormat, and thus
will follow the parsing rules defined by that class.
str - Locale-dependent number string (e.g., "4.0", or "4,0").
java.lang.NumberFormatException - thrown if the number cannot be parsed in the current localepublic java.lang.String formatCurrency(double currency)
currency - a double representing the value to be formatted as currencypublic java.lang.String formatPercent(double percent)
percent - a double representing the value to be formatted as a percentagepublic java.lang.String formatDate(java.util.Date date)
date - the Date object describing the date to be
formatted.
public java.lang.String formatDate(java.util.Date date,
BbLocale.Date dateStyle)
date - the Date object describing the date to be
formatted.dateStyle - a BbLocale.Date value defining how the date should
be formattedpublic java.lang.String formatTime(java.util.Date time)
time - the Date object describing the date to be
formatted.
public java.lang.String formatTime(java.util.Date time,
BbLocale.Time timeStyle)
time - the Date object describing the date to be
formatted.timeStyle - a BbLocale.Time value defining how the time portion
of the given date should be formattedpublic java.lang.String formatDateTime(java.util.Date dateTime)
dateTime - the Date object describing the date/time
to be formatted.
public java.lang.String formatDateTime(java.util.Date dateTime,
BbLocale.Date dateStyle,
BbLocale.Time timeStyle)
dateTime - the Date object describing the date/time
to be formatted.dateStyle - a BbLocale.Date value defining how the date portion
of the given date/time should be formattedtimeStyle - a BbLocale.Time value defining how the time portion
of the given date/time should be formattedpublic java.lang.String formatDuration(long duration)
duration - The time duration in milliseconds
public java.lang.String formatName(User user,
BbLocale.Name nameStyle)
BbLocale.Name style and returns it as a string.
user - the User whose name should be formattednameStyle - a BbLocale.Name value defining how the name of the
given user should be formatted
public java.lang.String formatName(java.lang.String strGivenName,
java.lang.String strMiddleName,
java.lang.String strFamilyName,
java.lang.String strTitle,
BbLocale.Name nameStyle)
BbLocale.Name
style and returns it as a string.
strGivenName - a String containing the User's first namestrMiddleName - a String containing the User's middle namestrFamilyName - a String containing the User's last namestrTitle - a String containing the User's titlenameStyle - a BbLocale.Name value defining how the given name
should be formattedpublic void setIsEditable(boolean b)
public java.lang.Boolean getIsEditable()
public void setVersion(Version v)
v - Fully qualified/parsed version objectpublic Version getVersion()
public void setVendorDescription(java.lang.String dscr)
dscr - Description. Must not exceed 255 characters. Excess data will
be truncated.public java.lang.String getVendorDescription()
public void setVendorURL(java.lang.String url)
url - Should be a string-based URL.public java.lang.String getVendorURL()
public void setVendorName(java.lang.String vendorName)
vendorName - vendor namepublic java.lang.String getVendorName()
public void setVendorId(java.lang.String vid)
vid - Blackboard-assigned vendor idpublic java.lang.String getVendorId()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||