|
Oracle® Globalization Development Kit Java API Reference 10g Release 1(10.1) B10971-01 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--oracle.i18n.servlet.localesource.LocaleSource
LocaleSource is the abstract base class for locale source
objects.
To create custom locale source objects for a globalized application, extend this class. The custom object may access the Oracle database to fetch and update the user locale preference, or it may access the LDAP server to get and set the language preference element.
By default, the following pre-defined LocaleSource are
available:
HttpAcceptLanguage: the locale preference set by the web client
in the HTTP header.
UserInputLocale: the locale preference in the parameters of GET
and POST methods.
ApplicationDefault: the default locale set in the application
configuration file.
LocaleSource are
provided:
DBLocaleSource: the locale preference stored in the Oracle
database.
LDAPLocaleSource: the locale preference stored in the LDAP
server.
The current user locale is determined according to the rules specified in
the GDK application configuration file. LocaleSource can
be extended in order to support other locale source types by adding a a
custome locale source and registering it in the configuration file.
| Nested Class Summary | |
static class |
LocaleSource.Alignment
LocaleSource.Alignment class represents the alignment of
text element.
|
static class |
LocaleSource.Parameter
LocaleSource.Parameter class represents locale and attribute
variable names. |
static class |
LocaleSource.WritingDirection
LocaleSource.WritingDirection class represents the writing
direction of the locale. |
| Field Summary | |
static String |
GET_INSTANCE_METHOD
|
| Constructor Summary | |
protected |
LocaleSource(Class cls,
boolean isCached,
boolean isReadOnly,
boolean isValidated)
Constructs a LocaleSource object |
| Method Summary | |
boolean |
equals(Object o)
Determines if a specific object equals to this object |
protected Object |
getAttribute(String key)
Returns the attribute object. |
String |
getCharacterSet()
Returns the character set name in this object. |
oracle.i18n.text.OraCollator |
getCollator()
Returns the Oracle collator object |
oracle.i18n.text.OraNumberFormat |
getCurrencyFormat()
Returns the Oracle currency format in this object. |
oracle.i18n.text.OraDateFormat |
getDateFormat(int style)
Returns the Oracle date format of the specified style in this object. |
oracle.i18n.text.OraDateFormat |
getDateTimeFormat(int style)
Returns the Oracle date and time format of the specified style in this object. |
String |
getISOCurrency()
Returns the ISO 4217 currency ID in this object. |
Locale |
getLocale()
Returns the locale object in this object. |
Class |
getLocaleSourceClass()
Returns the locale source class |
oracle.i18n.text.OraNumberFormat |
getNumberFormat()
Returns the Oracle number format in this object. |
oracle.i18n.text.OraDateFormat |
getTimeFormat()
Returns the Oracle time format in this object. |
TimeZone |
getTimeZone()
Returns the TimeZone in this object. |
LocaleSource.WritingDirection |
getWritingDirection()
Returns the writing direction in this object. |
int |
hashCode()
Returns the hash value of this object. |
boolean |
isCached()
Checks if the LocaleSource object will be cached |
boolean |
isReadOnly()
Checks if this LocaleSource object is read-only.
|
boolean |
isValidated()
Checks if the LocaleSource has been validated
if this flag is true, the validation of the given locale by
the application is omitted when the locale is retrieved, leading to
increaded application performance.
|
abstract boolean |
load()
Loads the locale and all attributes from the actual locale source into this object. |
protected void |
setAttribute(String key,
Object object)
Registers an attribute object in the LocaleSource.
|
void |
setCharacterSet(String charset)
Registers the Oracle character set name to store in the actual LocaleSource. |
void |
setCollator(oracle.i18n.text.OraCollator ocol)
Registers the Oracle collator to store into the actual o LocaleSource. |
void |
setCurrencyFormat(oracle.i18n.text.OraNumberFormat nfmt)
Registers the Oracle currency format object to store in the actual LocaleSource. |
void |
setDateFormat(int style,
oracle.i18n.text.OraDateFormat dtfmt)
Registers the Oracle date format object to store in the actual LocaleSource. |
void |
setDateTimeFormat(int dtstyle,
oracle.i18n.text.OraDateFormat dtfmt)
Registers the Oracle date time format object to store in the actual LocaleSource. |
void |
setISOCurrency(String currency)
Registers the ISO currency to store into the actual LocaleSource. |
void |
setLocale(Locale locale)
Registers the Locale with this object |
void |
setLocale(Locale locale,
oracle.i18n.servlet.ApplicationContext appctx)
Registers the locale object into this object |
void |
setLocaleSourceClass(Class loccls)
Registers the locale source class object. |
void |
setNumberFormat(oracle.i18n.text.OraNumberFormat nfmt)
Registers the Oracle number format object to store into the actual LocaleSource. |
void |
setTimeFormat(oracle.i18n.text.OraDateFormat tmfmt)
Registers the Oracle time format object to store in the actual LocaleSource. |
void |
setTimeZone(TimeZone tz)
Registers the TimeZone ID to store in the actual
LocaleSource. |
void |
setWritingDirection(LocaleSource.WritingDirection wdir)
Registers the writing direction to store in the actual LocaleSource. |
abstract boolean |
store()
Stores the locale and all attributes of the object in the actual LocaleSource.
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String GET_INSTANCE_METHOD
| Constructor Detail |
protected LocaleSource(Class cls,
boolean isCached,
boolean isReadOnly,
boolean isValidated)
cls - a Class that represents the subclass of
LocaleSource.isCached - true if the locale source is cache-able.isReadOnly - true if the locale source is read-onlyisValidated - true if the locale source has already been validated.
By skipping validation, this improves a performance.| Method Detail |
public final boolean isCached()
LocaleSource object will be cached
true if this object will be cached;
false otherwise.public final boolean isReadOnly()
LocaleSource object is read-only.
If this is true, creation and update operations on this object will be omitted.
true if this object is read-only; false
otherwise.public final boolean isValidated()
LocaleSource has been validated
if this flag is true, the validation of the given locale by
the application is omitted when the locale is retrieved, leading to
increaded application performance.
true if this object has been validated;
false otherwise.public abstract boolean store()
LocaleSource.
This method must be implemented by the concrete classes.
true if the storing operation is successfull;
false otherwise.public abstract boolean load()
This method must be implemented by the concrete classes.
true if the loading operation is successfull;
false otherwise.public final void setLocale(Locale locale)
Locale with this object
locale - the Locale object.
public final void setLocale(Locale locale,
oracle.i18n.servlet.ApplicationContext appctx)
locale - the Locale objectappctx - the ApplicationContext objectpublic final void setISOCurrency(String currency)
LocaleSource.
currency - the ISO currency ID defined in ISO 4217.public final void setCharacterSet(String charset)
LocaleSource.
charset - the character set name of Oracle.public final void setLocaleSourceClass(Class loccls)
loccls - a Class objectpublic final void setTimeZone(TimeZone tz)
TimeZone ID to store in the actual
LocaleSource.
tz - a TimeZone object to register
public final void setDateTimeFormat(int dtstyle,
oracle.i18n.text.OraDateFormat dtfmt)
LocaleSource.
dtstyle - the date format style defined in
OraDateFormat.dtfmt - an OraDateFormat object
public final void setDateFormat(int style,
oracle.i18n.text.OraDateFormat dtfmt)
LocaleSource.
style - the date format style defined in OraDateFormat.dtfmt - an OraDateFormat objectpublic final void setTimeFormat(oracle.i18n.text.OraDateFormat tmfmt)
LocaleSource.
tmfmt - an OraDateFormat objectpublic final void setWritingDirection(LocaleSource.WritingDirection wdir)
LocaleSource.
wdir - a writing direction of text on displaypublic final void setCurrencyFormat(oracle.i18n.text.OraNumberFormat nfmt)
LocaleSource.
nfmt - an OraNumberFormat object to registerpublic final void setNumberFormat(oracle.i18n.text.OraNumberFormat nfmt)
LocaleSource.
nfmt - an OraNumberFormat object to registerpublic final void setCollator(oracle.i18n.text.OraCollator ocol)
LocaleSource.
ocol - an OraCollator object to register
protected final void setAttribute(String key,
Object object)
LocaleSource.
Used in the concrete classes to set custom attributes.
Note the attribute object must be Serializable.
key - a String key of objectobject - an objectpublic final Locale getLocale()
Locale object.public final String getISOCurrency()
public final String getCharacterSet()
public final Class getLocaleSourceClass()
public final TimeZone getTimeZone()
TimeZone objectpublic final oracle.i18n.text.OraDateFormat getDateTimeFormat(int style)
style - the Date fromat style
OraDateFormat object.public final oracle.i18n.text.OraDateFormat getDateFormat(int style)
style - the Date fromat style
OraDateFormat object.public final oracle.i18n.text.OraDateFormat getTimeFormat()
public final LocaleSource.WritingDirection getWritingDirection()
WritingDirection objectpublic final oracle.i18n.text.OraNumberFormat getCurrencyFormat()
OraNumberFormat objectpublic final oracle.i18n.text.OraNumberFormat getNumberFormat()
OraNumberFormat objectpublic final oracle.i18n.text.OraCollator getCollator()
OraCollator objectprotected final Object getAttribute(String key)
Used in the concrete classes to retrieve custom attributes. Note the
attribute object must be Serializable.
key - a String key of object
Object associated with the keypublic boolean equals(Object o)
equals in class Objecto - an Object to be compared
true if the Objects are equal;
false otherwise.public int hashCode()
hashCode in class Object
|
Oracle® Globalization Development Kit Java API Reference 10g Release 1(10.1) B10971-01 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||