home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
VCAFE.3.0A
/
Main.bin
/
ResourceBundleAdapter.java
< prev
next >
Wrap
Text File
|
1998-10-03
|
2KB
|
101 lines
package com.symantec.itools.util;
import java.util.Enumeration;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class ResourceBundleAdapter
{
protected ResourceBundle bundle;
public ResourceBundleAdapter(ResourceBundle b)
{
bundle = b;
}
public Enumeration getKeys()
{
return (bundle.getKeys());
}
public Object getObject(String key)
{
return (getObject(key, null));
}
public Object getObject(String key, Object defaultValue)
{
try
{
return (bundle.getObject(key));
}
catch(MissingResourceException ex)
{
}
return (defaultValue);
}
public String getString(String key)
{
return (getString(key, null));
}
public String getString(String key, String defaultValue)
{
try
{
return (bundle.getString(key));
}
catch(MissingResourceException ex)
{
}
return (defaultValue);
}
public String[] getStringArray(String key)
{
return (getStringArray(key, null));
}
public String[] getStringArray(String key, String[] defaultValue)
{
try
{
return (bundle.getStringArray(key));
}
catch(MissingResourceException ex)
{
}
return (defaultValue);
}
public char getChar(String key)
{
return (getChar(key, (char)0));
}
public char getChar(String key, char defaultValue)
{
try
{
String str;
str = bundle.getString(key);
if(str.length() > 0)
{
return (str.charAt(0));
}
}
catch(MissingResourceException ex)
{
}
return (defaultValue);
}
}