|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.util.LocalizedResource
LocalizedResource contains the utility methods for finding and opening the resource that
best matches the given Locale.
Supported API: true
Extendable: false
Nested Class Summary | |
(package private) static class |
LocalizedResource.CacheEntry
|
Field Summary | |
private String[] |
altExtensions
|
private static Hashtable |
cacheList
|
private static boolean |
debug
|
private String |
foundName
|
private String |
givenName
|
private InputStream |
inputStream
|
private Locale |
loc
|
private static String |
RESOURCE
|
Constructor Summary | |
LocalizedResource(String resourceName)
Supported API: true |
|
LocalizedResource(String resourceName,
String alternateExtension)
Supported API: true |
|
LocalizedResource(String resourceName,
String[] alternateExtensions)
|
Method Summary | |
protected void |
closeInputStream()
Close input stream of this instance. |
private void |
findResource(String resourceName,
String[] alternateExtensions,
Locale locale)
|
private void |
findResource(String resourceName,
String[] alternateExtensions,
Locale locale,
boolean includeBase)
|
private void |
findResource(String resourceName,
String[] alternateExtensions,
String locale,
boolean includeBase)
|
private void |
findResource(String resourceName,
String[] alternateExtensions,
Vector preferences)
|
protected InputStream |
getInputStream()
Return input stream of best matching resource. |
Locale |
getLocale()
Get the Locale object for this instance. |
static String |
getLocalizedResourceName(Locale aLocale,
String aFilename)
Returns the Localized name of a Resource, with a specified Locale and a filename. |
static String |
getLocalizedResourceName(WTContext aContext,
String aFilename)
Returns the Localized name of a Resource, with a specified Locale and a filename. |
private void |
getResource(String resource)
|
String |
getResourceName()
Get the resource name that best matched. |
protected void |
init()
Look for the given resource for the server's locale. |
protected void |
init(Locale locale)
Look for the given resource for the given locale. |
void |
init(Vector preferences)
Look for the given resource for the given locales. |
InputStream |
openResource()
Look for the given resource for the server's locale. |
InputStream |
openResource(Locale locale)
Look for the given resource for the given locale. |
InputStream |
openResource(Vector preferences)
Look for the given resource for the given locales. |
static void |
setDebug(boolean value)
Sets the debug value which controls logging from this class. |
void |
setLocale(Locale locale)
Set the Locale object for this instance. |
private void |
setLocale(String fname)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static boolean debug
private static Hashtable cacheList
private Locale loc
private String[] altExtensions
private String givenName
private String foundName
private InputStream inputStream
Constructor Detail |
public LocalizedResource(String resourceName)
public LocalizedResource(String resourceName, String alternateExtension)
public LocalizedResource(String resourceName, String[] alternateExtensions)
Method Detail |
public Locale getLocale()
public String getResourceName()
public void setLocale(Locale locale)
public static String getLocalizedResourceName(WTContext aContext, String aFilename)
Replaces LocaleHelper.translateURLString( )
aFilename
- The filename to generate the file around.
public static String getLocalizedResourceName(Locale aLocale, String aFilename)
Replaces LocaleHelper.translateURLString( )
aLocale
- The locale to generate the file with.aFilename
- The filename to generate the file around.
public static void setDebug(boolean value)
protected void init(Locale locale) throws WTException
locale
- The locale to search on.
WTException
- Thrown if an IO exception occurs.protected void init() throws WTException
WTException
- Thrown if an IO exception occurs.public void init(Vector preferences) throws WTException
preferences
- Vector containing the locales to search on.
WTException
- Thrown if an IO exception occurs.protected InputStream getInputStream() throws WTException
WTException
- Thrown if an IO exception occurs.protected void closeInputStream()
public InputStream openResource(Locale locale) throws WTException
locale
- The locale to search on.
WTException
- Thrown if an IO exception occurs.public InputStream openResource() throws WTException
WTException
- Thrown if an IO exception occurs.public InputStream openResource(Vector preferences) throws WTException
preferences
- Vector containing the locales to search on.
WTException
- Thrown if an IO exception occurs.private void findResource(String resourceName, String[] alternateExtensions, Locale locale, boolean includeBase) throws WTException
WTException
private void findResource(String resourceName, String[] alternateExtensions, Locale locale) throws WTException
WTException
private void findResource(String resourceName, String[] alternateExtensions, Vector preferences) throws WTException
WTException
private void findResource(String resourceName, String[] alternateExtensions, String locale, boolean includeBase) throws WTException
WTException
private void getResource(String resource) throws WTException
WTException
private void setLocale(String fname)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |