Package org.eigenbase.resgen
Interface Resource
-
public interface ResourceAResourceis 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,
ResourceGencan generate Java a wrapper class which implements this interface, and also has a method to create an error for each message.- Since:
- 3 December, 2001
- Version:
- $Id: //open/util/resgen/src/org/eigenbase/resgen/Resource.java#4 $
- Author:
- jhyde
-
-
Field Summary
Fields Modifier and Type Field Description static intSEVERITY_ERRstatic intSEVERITY_INFOstatic intSEVERITY_NON_FATAL_ERRstatic intSEVERITY_WARN
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringformatError(int code, java.lang.Object[] args)Formats the message corresponding tocodewith the given arguments.java.util.LocalegetLocale()Returns the locale of the messages.intgetSeverity(int code)Returns the severity of this message.voidinit(java.net.URL url, java.util.Locale locale)Populates thisResourcefrom a URL.voidinit(ResourceDef.ResourceBundle resourceList, java.util.Locale locale)Populates thisResourcefrom an XML document.
-
-
-
Field Detail
-
SEVERITY_INFO
static final int SEVERITY_INFO
- See Also:
- Constant Field Values
-
SEVERITY_ERR
static final int SEVERITY_ERR
- See Also:
- Constant Field Values
-
SEVERITY_WARN
static final int SEVERITY_WARN
- See Also:
- Constant Field Values
-
SEVERITY_NON_FATAL_ERR
static final int SEVERITY_NON_FATAL_ERR
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
void init(java.net.URL url, java.util.Locale locale) throws java.io.IOExceptionPopulates thisResourcefrom a URL.- Parameters:
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- Throws:
IOException- ifurlcannot be opened, or if the format of its contents are invalid
-
init
void init(ResourceDef.ResourceBundle resourceList, java.util.Locale locale)
Populates thisResourcefrom an XML document.- Parameters:
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 messages
-
getLocale
java.util.Locale getLocale()
Returns the locale of the messages.
-
formatError
java.lang.String formatError(int code, java.lang.Object[] args)Formats the message corresponding tocodewith the given arguments. If an argument is not supplied, the tokens remain in the returned message string.
-
getSeverity
int getSeverity(int code)
Returns the severity of this message.
-
-