|
Oracle® Globalization Development Kit Java API Reference 10g Release 1 (10.1.0.0) Part No. B10971-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.i18n.servlet.ApplicationContext
The ApplicationContext
class is an application context class that controls application scope operations in the framework.
An instance of this object must be created at the startup time of the application either by the ContextListener
object or in a custom context listener for Java/JSP server applications and be registered in the servlet context with the key ApplicationContext.OBJECT
.
Field Summary | |
static String |
DEFAULT_GDKAPP Default GDK application configuration file name. |
static String |
OBJECT_KEY Constant for key used to retrieve this object. |
Constructor Summary | |
ApplicationContext(InputStream pathToConfigFile) Constructs this object based on the application configuration file. |
|
ApplicationContext(InputStream pathToConfigFile, ClassLoader cloader) Constructs this object based on the application configuration file and the ClassLoader object. |
|
ApplicationContext(String pathToConfigFile) Constructs this object based on the application configuration file. |
|
ApplicationContext(String pathToConfigFile, ClassLoader cloader) Constructs this object based on the application configuration file and the ClassLoader object. |
Method Summary | |
Locale |
fallbackLocale(Locale locale) Validates if the locale supplied as an argument is supported. |
oracle.i18n.servlet.localesource.LocaleSource |
getApplicationDefaultLocaleSource() Returns the application default locale source instance. |
String |
getIANAPageCharacterSet() Returns the default IANA page character set name of the application or returns the string AUTO-CHARSET . |
Class[] |
getLocaleSources() Returns locale sources examined in this order to determine the current locale. |
Map |
getMessageBundle() Returns the map of the message bundle object. |
String |
getParameterName(LocaleSource.Parameter parameter) Returns a String representing the parameter name used to specify locale attributes. |
String[] |
getSupportedIANACharacterSets() Returns supported IANA character sets. |
Locale[] |
getSupportedLocales() Returns locales supported in the application. |
String[] |
getSupportedOraLanguages() Returns supported Oracle languages. |
String[] |
getSupportedOraLanguages(String oraTerritory) Returns supported Oracle languages for the Oracle territory. |
String[] |
getSupportedOraTerritories() Returns supported Oracle territories. |
String[] |
getSupportedOraTerritories(String oraLanguage) Returns supported Oracle territories for the Oracle language. |
int |
hashCode() Returns the hash value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String OBJECT_KEY
ApplicationContext
object in the ServletContext
object.
public static final String DEFAULT_GDKAPP
Constructor Detail |
public ApplicationContext(String pathToConfigFile) throws ClassNotFoundException, RESyntaxException, UnsupportedEncodingException
ClassLoader
object is derived from this object.
Note: Do not use this method for JSP/Java Servlet application.
pathToConfigFile
- an absolute file path of the application configuration fileClassNotFoundException
- if locale source class is not foundRESyntaxException
- if rewriting rule or locale to charset mapping regular expression is invalidUnsupportedEncodingException
- if character set is invalidpublic ApplicationContext(InputStream pathToConfigFile) throws ClassNotFoundException, RESyntaxException, UnsupportedEncodingException
ClassLoader
object is derived from this object.pathToConfigFile
- an input stream object that references the application configuration fileClassNotFoundException
- if locale source class is not foundRESyntaxException
- if rewriting rule or locale to charset mapping regular expression is invalidUnsupportedEncodingException
- if character set is invalidpublic ApplicationContext(String pathToConfigFile, ClassLoader cloader) throws ClassNotFoundException, RESyntaxException, UnsupportedEncodingException
ClassLoader
object. The class loader may be required when a custom LocaleSource
object is used in the application configuration file.
Note: Do not use this method for JSP/Java Servlet application.
pathToConfigFile
- an absolute file path of the application configuration filecloader
- a class loader class usedClassNotFoundException
- if locale source class is not foundRESyntaxException
- if rewriting rule or locale to charset mapping regular expression is invalidUnsupportedEncodingException
- if character set is invalidpublic ApplicationContext(InputStream pathToConfigFile, ClassLoader cloader) throws ClassNotFoundException, RESyntaxException, UnsupportedEncodingException
ClassLoader
object. The class loader is required if you use a custom LocaleSource
object and specify it in the application configuration file.pathToConfigFile
- an input stream object that references the application configuration filecloader
- a class loader class usedClassNotFoundException
- if locale source class is not foundRESyntaxException
- if rewriting rule or locale to charset mapping regular expression is invalidUnsupportedEncodingException
- if character set is invalidMethod Detail |
public String getIANAPageCharacterSet()
AUTO-CHARSET
.
For AUTO-CHARSET
, retrieve the actual name of character set using the Localizer.getIANACharacterSet()
method.
AUTO-CHARSET
public String getParameterName(LocaleSource.Parameter parameter)
String
representing the parameter name used to specify locale attributes. For example, if you want to get the locale value, use the LocaleSource.LOCALE
object as input. For example:
ApplicationContext appctx = ServletHelper.getApplicationContextInstance( request); String plocale = request.getParameter( appctx.getParameterName(LocaleSource.LOCALE));
parameter
- a parameter typepublic Class[] getLocaleSources()
LocaleSource
classespublic oracle.i18n.servlet.localesource.LocaleSource getApplicationDefaultLocaleSource()
LocaleSource
representing the application default localepublic Map getMessageBundle()
String
and the value is the ResourceBundle
objectpublic Locale[] getSupportedLocales()
The supported locale can be specified in the application configration file.
Locale
representing supported locales in the applicationpublic String[] getSupportedOraLanguages(String oraTerritory)
The supported languages are determined by the supported locale. If the given territory name is null
, all supported Oracle languages are returned.
oraTerritory
- Oracle territory nameString
representing the supported languages in the applicationpublic String[] getSupportedOraLanguages()
The supported languages are determined by the supported locale.
String
representing the supported languages in the applicationpublic String[] getSupportedOraTerritories(String oraLanguage)
The supported territories are determined by the supported locale. If the given language is null
, all available territories are returned.
oraLanguage
- Oracle language nameString
representing the supported territories in the applicationpublic String[] getSupportedOraTerritories()
The supported territories are determined by the supported locale.
String
representing the supported territories in the applicationpublic String[] getSupportedIANACharacterSets()
public Locale fallbackLocale(Locale locale)
If you are not sure that the given locale is supported, call this method the custom locale source object.
Note that supported locales in the application are not equivalent to the translation locales that are handled by the ResourceBundle
class or the ServletHelper.rewriteURL(String, HttpServletRequest)
method. They validate locales by checking the actual translation resources. If the given locale's translation exists, it is returned, otherwise, it returns the fallback locale's translation.
locale
- a Locale
object to be examinedLocale
that is supported by the applicationpublic int hashCode()
hashCode
in class Object
|
Oracle® Globalization Development Kit Java API Reference 10g Release 1 (10.1.0.0) Part No. B10971-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |