|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.text.LocalizableException
public class LocalizableException
An exception class whose exception message can be localized. Construct a LocalizableException with a resource bundle name, a resource key, and an array of arguments.
| Constructor Summary | |
|---|---|
LocalizableException()
Create a default LocalizableException instance. |
|
LocalizableException(java.lang.String message)
Create a LocalizableException instance with a default message. |
|
LocalizableException(java.lang.String bundleName,
java.lang.String resourceName,
java.lang.Object[] args,
java.lang.ClassLoader classLoader)
Construct a LocalizableException using the elements necessary to render the exception under different locales. |
|
LocalizableException(java.lang.String message,
java.lang.Throwable cause)
Contructs a LocalizableException with a message and causal exception. |
|
| Method Summary | |
|---|---|
java.lang.String |
getBundleName()
Return the bundleName property, which names the resource bundle that contains the localizable message format. |
java.lang.ClassLoader |
getClassLoader()
Get the value of the classLoader property. |
protected java.lang.String |
getDefaultMessage()
Return the default, non-localized message string. |
java.lang.String |
getMessage()
Return the exception message using the default locale, Locale.getDefault(). |
java.lang.String |
getMessage(java.util.Locale locale)
Return the exception message for the specificed locale. |
java.lang.Object[] |
getMessageArguments()
Return the arguments with which a message format, based on the resource name, is formatted
via MessageFormat.format(String, Object[]) |
java.lang.String |
getResourceName()
Return the name of the resource string within the resource bundle. |
void |
setBundleName(java.lang.String _bundleName)
Set the name of the resource bundle from which the localizable exception message is read. |
void |
setClassLoader(java.lang.ClassLoader _classLoader)
Set the value of the classLoader property. |
void |
setMessage(java.lang.String bundleName,
java.lang.String resourceName,
java.lang.Object[] args)
Set the elements of a localizable message. |
void |
setMessage(java.lang.String bundleName,
java.lang.String resourceName,
java.lang.Object[] args,
java.lang.ClassLoader classLoader)
Set the elements of a localizable message. |
void |
setMessageArguments(java.lang.Object[] _messageArguments)
Set the message format arguments. |
void |
setResourceName(java.lang.String _resourceName)
Set the name of the resource string within the resource bundle. |
| Constructor Detail |
|---|
public LocalizableException()
setMessage(String bundleName, String resourceName, Object[] args, ClassLoader classLoader)
Consider using the
LocalizableException(String bundleName, String resourceName, Object[] args, ClassLoader classLoader)
constructor instead.
public LocalizableException(java.lang.String message)
setMessage(String bundleName, String resourceName, Object[] args)
Consider using the
LocalizableException(String bundleName, String resourceName, Object[] args, ClassLoader classLoader)
constructor instead.
public LocalizableException(java.lang.String bundleName,
java.lang.String resourceName,
java.lang.Object[] args,
java.lang.ClassLoader classLoader)
bundleName - the name of a resource bundle, such as "com.sas.text.Resources"resourceName - The name of a resource within the resource bundle.args - An array of arguments which are formatted using a MessageFormat
and the message obtained from the resourceNameclassLoader - The class loader of the class from which the resource bundle
is loaded. Normally, this is the instaniating class' class loader. Since
the client which formats the exception may reside in a different class loader,
it may not be able to find the correct resource bundle. This class loader
allows this LocalizableException to find the correct resource bundle.
public LocalizableException(java.lang.String message,
java.lang.Throwable cause)
message - Thecause - | Method Detail |
|---|
public java.lang.ClassLoader getClassLoader()
public void setClassLoader(java.lang.ClassLoader _classLoader)
classLoader - New value to assign to the classLoader property.public java.lang.String getBundleName()
public void setBundleName(java.lang.String _bundleName)
bundleName - The name of the resource bundle.public java.lang.String getResourceName()
MessageFormat.format(String, Object[])
public void setResourceName(java.lang.String _resourceName)
public java.lang.Object[] getMessageArguments()
resource name, is formatted
via MessageFormat.format(String, Object[])
public void setMessageArguments(java.lang.Object[] _messageArguments)
public void setMessage(java.lang.String bundleName,
java.lang.String resourceName,
java.lang.Object[] args)
bundleName - the name of a resource bundleresourceName - the name of the resource from the bundleargs - the arguments to pass to a MessageFormat object.
public void setMessage(java.lang.String bundleName,
java.lang.String resourceName,
java.lang.Object[] args,
java.lang.ClassLoader classLoader)
bundleName - the name of a resource bundleresourceName - the name of the resource from the bundleargs - the arguments to pass to a MessageFormat object.protected java.lang.String getDefaultMessage()
LocalizableException(String) constructor,
or it is the concatenation of the bundle name and the resource name.
public java.lang.String getMessage()
Locale.getDefault().
getMessage in class java.lang.Throwablepublic java.lang.String getMessage(java.util.Locale locale)
locale - The locale in which the message should be formatted.
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||