|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Resource
A Resource
is a collection of messages for a particular
software component and locale. It is loaded from an XML file whose root
element is <BaflResourceList>
.
Given such an XML file, ResourceGen
can generate Java a wrapper
class which implements this interface, and also has a method to create an
error for each message.
Field Summary | |
---|---|
static int |
SEVERITY_ERR
|
static int |
SEVERITY_INFO
|
static int |
SEVERITY_NON_FATAL_ERR
|
static int |
SEVERITY_WARN
|
Method Summary | |
---|---|
java.lang.String |
formatError(int code,
java.lang.Object[] args)
Formats the message corresponding to code with the given
arguments. |
java.util.Locale |
getLocale()
Returns the locale of the messages. |
int |
getSeverity(int code)
Returns the severity of this message. |
void |
init(ResourceDef.ResourceBundle resourceList,
java.util.Locale locale)
Populates this Resource from an XML document. |
void |
init(java.net.URL url,
java.util.Locale locale)
Populates this Resource from a URL. |
Field Detail |
---|
static final int SEVERITY_INFO
static final int SEVERITY_ERR
static final int SEVERITY_WARN
static final int SEVERITY_NON_FATAL_ERR
Method Detail |
---|
void init(java.net.URL url, java.util.Locale locale) throws java.io.IOException
Resource
from a URL.
url
- The URL of the XML file containing the error messageslocale
- The ISO locale code (e.g. "en"
, or
"en_US"
, or "en_US_WIN"
) of the messages
IOException
- if url
cannot be opened, or if the
format of its contents are invalidvoid init(ResourceDef.ResourceBundle resourceList, java.util.Locale locale)
Resource
from an XML document.
resourceList
- The URL of the XML file containing the error messageslocale
- The ISO locale code (e.g. "en"
, or
"en_US"
, or "en_US_WIN"
) of the messagesjava.util.Locale getLocale()
java.lang.String formatError(int code, java.lang.Object[] args)
code
with the given
arguments. If an argument is not supplied, the tokens remain in the
returned message string.
int getSeverity(int code)
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |