| org.geotools.resources.IndexedResourceBundle org.geotools.resources.ResourceBundle org.geotools.resources.IndexedResourceBundle
All known Subclasses: org.geotools.resources.ResourceBundle,
IndexedResourceBundle | public class IndexedResourceBundle extends ResourceBundle (Code) | | ResourceBundle implementation using integers instead of strings for resource
keys. Because it doesn't use strings, this implementation avoids adding all those string
constants to
.class files and runtime images. Developers still have meaningful labels
in their code (e.g.
DIMENSION_MISMATCH ) through a set of constants defined in interfaces.
This approach furthermore gives the benefit of compile-time safety. Because integer constants are
inlined right into class files at compile time, the declarative interface is never loaded at run
time. This class also provides facilities for string formatting using
MessageFormat .
since: 2.4 version: $Id: IndexedResourceBundle.java 27862 2007-11-12 19:51:19Z desruisseaux $ author: Martin Desruisseaux |
Method Summary | |
public static String | format(LogRecord record) Localize and format the message string from a log record. | final public Enumeration | getKeys() Returns an enumeration of the keys. | final public String | getLabel(int key) Gets a string for the given key and appends ": " to it.
This method is typically used for creating labels.
Parameters: key - The key for the desired string. | public LogRecord | getLogRecord(Level level, int key) Gets a localized log record.
Parameters: level - The log record level. Parameters: key - The resource key. | public LogRecord | getLogRecord(Level level, int key, Object arg0) Gets a localized log record.
Parameters: level - The log record level. Parameters: key - The resource key. Parameters: arg0 - The parameter for the log message, or null . | public LogRecord | getLogRecord(Level level, int key, Object arg0, Object arg1) Gets a localized log record.
Parameters: level - The log record level. Parameters: key - The resource key. Parameters: arg0 - The first parameter. Parameters: arg1 - The second parameter. | public LogRecord | getLogRecord(Level level, int key, Object arg0, Object arg1, Object arg2) Gets a localized log record.
Parameters: level - The log record level. Parameters: key - The resource key. Parameters: arg0 - The first parameter. Parameters: arg1 - The second parameter. Parameters: arg2 - The third parameter. | public LogRecord | getLogRecord(Level level, int key, Object arg0, Object arg1, Object arg2, Object arg3) Gets a localized log record.
Parameters: level - The log record level. Parameters: key - The resource key. Parameters: arg0 - The first parameter. Parameters: arg1 - The second parameter. Parameters: arg2 - The third parameter. Parameters: arg3 - The fourth parameter. | final public String | getMenuLabel(int key) Gets a string for the given key and appends "..." to it.
This method is typically used for creating menu items.
Parameters: key - The key for the desired string. | final public String | getString(int key) Gets a string for the given key from this resource bundle or one of its parents.
Parameters: key - The key for the desired string. | final public String | getString(int key, Object arg0) Gets a string for the given key and formats it with the specified argument. | final public String | getString(int key, Object arg0, Object arg1) Gets a string for the given key and replaces all occurrences of "{0}",
"{1}", with values of
arg0 ,
arg1 , etc.
Parameters: key - The key for the desired string. Parameters: arg0 - Value to substitute for "{0}". Parameters: arg1 - Value to substitute for "{1}". | final public String | getString(int key, Object arg0, Object arg1, Object arg2) Gets a string for the given key and replaces all occurrences of "{0}",
"{1}", with values of
arg0 ,
arg1 , etc.
Parameters: key - The key for the desired string. Parameters: arg0 - Value to substitute for "{0}". Parameters: arg1 - Value to substitute for "{1}". Parameters: arg2 - Value to substitute for "{2}". | final public String | getString(int key, Object arg0, Object arg1, Object arg2, Object arg3) Gets a string for the given key and replaces all occurrences of "{0}",
"{1}", with values of
arg0 ,
arg1 , etc.
Parameters: key - The key for the desired string. Parameters: arg0 - Value to substitute for "{0}". Parameters: arg1 - Value to substitute for "{1}". Parameters: arg2 - Value to substitute for "{2}". Parameters: arg3 - Value to substitute for "{3}". | final public String | getString(int key, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4) Gets a string for the given key and replaces all occurrences of "{0}",
"{1}", with values of
arg0 ,
arg1 , etc.
Parameters: key - The key for the desired string. Parameters: arg0 - Value to substitute for "{0}". Parameters: arg1 - Value to substitute for "{1}". Parameters: arg2 - Value to substitute for "{2}". Parameters: arg3 - Value to substitute for "{3}". Parameters: arg4 - Value to substitute for "{4}". | final protected Object | handleGetObject(String key) Gets an object for the given key from this resource bundle. | final public void | list(Writer out) Lists resources to the specified stream. | public synchronized String | toString() Returns a string representation of this object. |
IndexedResourceBundle | protected IndexedResourceBundle()(Code) | | Constructs a new resource bundle. The resource filename will be inferred from
the fully qualified classname of this
IndexedResourceBundle subclass.
|
IndexedResourceBundle | protected IndexedResourceBundle(String filename)(Code) | | Constructs a new resource bundle.
Parameters: filename - The resource name containing resources.It may be a filename or an entry in a JAR file. |
getLabel | final public String getLabel(int key) throws MissingResourceException(Code) | | Gets a string for the given key and appends ": " to it.
This method is typically used for creating labels.
Parameters: key - The key for the desired string. The string for the given key. throws: MissingResourceException - If no object for the given key can be found. |
getLogRecord | public LogRecord getLogRecord(Level level, int key)(Code) | | Gets a localized log record.
Parameters: level - The log record level. Parameters: key - The resource key. The log record. |
getLogRecord | public LogRecord getLogRecord(Level level, int key, Object arg0)(Code) | | Gets a localized log record.
Parameters: level - The log record level. Parameters: key - The resource key. Parameters: arg0 - The parameter for the log message, or null . The log record. |
getLogRecord | public LogRecord getLogRecord(Level level, int key, Object arg0, Object arg1)(Code) | | Gets a localized log record.
Parameters: level - The log record level. Parameters: key - The resource key. Parameters: arg0 - The first parameter. Parameters: arg1 - The second parameter. The log record. |
getLogRecord | public LogRecord getLogRecord(Level level, int key, Object arg0, Object arg1, Object arg2)(Code) | | Gets a localized log record.
Parameters: level - The log record level. Parameters: key - The resource key. Parameters: arg0 - The first parameter. Parameters: arg1 - The second parameter. Parameters: arg2 - The third parameter. The log record. |
getLogRecord | public LogRecord getLogRecord(Level level, int key, Object arg0, Object arg1, Object arg2, Object arg3)(Code) | | Gets a localized log record.
Parameters: level - The log record level. Parameters: key - The resource key. Parameters: arg0 - The first parameter. Parameters: arg1 - The second parameter. Parameters: arg2 - The third parameter. Parameters: arg3 - The fourth parameter. The log record. |
getMenuLabel | final public String getMenuLabel(int key) throws MissingResourceException(Code) | | Gets a string for the given key and appends "..." to it.
This method is typically used for creating menu items.
Parameters: key - The key for the desired string. The string for the given key. throws: MissingResourceException - If no object for the given key can be found. |
getString | final public String getString(int key) throws MissingResourceException(Code) | | Gets a string for the given key from this resource bundle or one of its parents.
Parameters: key - The key for the desired string. The string for the given key. throws: MissingResourceException - If no object for the given key can be found. |
getString | final public String getString(int key, Object arg0) throws MissingResourceException(Code) | | Gets a string for the given key and formats it with the specified argument. The message is
formatted using
MessageFormat . Calling this method is approximately equivalent to
calling:
String pattern = getString(key);
Format f = new MessageFormat(pattern);
return f.format(arg0);
If
arg0 is not already an array, it will be placed into an array of length 1. Using
MessageFormat , all occurrences of "{0}", "{1}", "{2}" in the resource string will be
replaced by
arg0[0] ,
arg0[1] ,
arg0[2] , etc.
Parameters: key - The key for the desired string. Parameters: arg0 - A single object or an array of objects to be formatted and substituted. The string for the given key. throws: MissingResourceException - If no object for the given key can be found. See Also: IndexedResourceBundle.getString(String) See Also: IndexedResourceBundle.getString(int,Object,Object) See Also: IndexedResourceBundle.getString(int,Object,Object,Object) See Also: MessageFormat |
getString | final public String getString(int key, Object arg0, Object arg1) throws MissingResourceException(Code) | | Gets a string for the given key and replaces all occurrences of "{0}",
"{1}", with values of
arg0 ,
arg1 , etc.
Parameters: key - The key for the desired string. Parameters: arg0 - Value to substitute for "{0}". Parameters: arg1 - Value to substitute for "{1}". The formatted string for the given key. throws: MissingResourceException - If no object for the given key can be found. |
getString | final public String getString(int key, Object arg0, Object arg1, Object arg2) throws MissingResourceException(Code) | | Gets a string for the given key and replaces all occurrences of "{0}",
"{1}", with values of
arg0 ,
arg1 , etc.
Parameters: key - The key for the desired string. Parameters: arg0 - Value to substitute for "{0}". Parameters: arg1 - Value to substitute for "{1}". Parameters: arg2 - Value to substitute for "{2}". The formatted string for the given key. throws: MissingResourceException - If no object for the given key can be found. |
getString | final public String getString(int key, Object arg0, Object arg1, Object arg2, Object arg3) throws MissingResourceException(Code) | | Gets a string for the given key and replaces all occurrences of "{0}",
"{1}", with values of
arg0 ,
arg1 , etc.
Parameters: key - The key for the desired string. Parameters: arg0 - Value to substitute for "{0}". Parameters: arg1 - Value to substitute for "{1}". Parameters: arg2 - Value to substitute for "{2}". Parameters: arg3 - Value to substitute for "{3}". The formatted string for the given key. throws: MissingResourceException - If no object for the given key can be found. |
getString | final public String getString(int key, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4) throws MissingResourceException(Code) | | Gets a string for the given key and replaces all occurrences of "{0}",
"{1}", with values of
arg0 ,
arg1 , etc.
Parameters: key - The key for the desired string. Parameters: arg0 - Value to substitute for "{0}". Parameters: arg1 - Value to substitute for "{1}". Parameters: arg2 - Value to substitute for "{2}". Parameters: arg3 - Value to substitute for "{3}". Parameters: arg4 - Value to substitute for "{4}". The formatted string for the given key. throws: MissingResourceException - If no object for the given key can be found. |
handleGetObject | final protected Object handleGetObject(String key)(Code) | | Gets an object for the given key from this resource bundle.
Returns null if this resource bundle does not contain an
object for the given key.
Parameters: key - the key for the desired object exception: NullPointerException - if key is null the object for the given key, or null |
list | final public void list(Writer out) throws IOException(Code) | | Lists resources to the specified stream. If a resource has more than one line, only
the first line will be written. This method is used mostly for debugging purposes.
Parameters: out - The destination stream. throws: IOException - if an output operation failed. |
toString | public synchronized String toString()(Code) | | Returns a string representation of this object.
This method is for debugging purposes only.
|
Methods inherited from org.geotools.resources.IndexedResourceBundle | public static String format(LogRecord record)(Code)(Java Doc) final public Enumeration getKeys()(Code)(Java Doc) final public String getLabel(int key) throws MissingResourceException(Code)(Java Doc) public LogRecord getLogRecord(Level level, int key)(Code)(Java Doc) public LogRecord getLogRecord(Level level, int key, Object arg0)(Code)(Java Doc) public LogRecord getLogRecord(Level level, int key, Object arg0, Object arg1)(Code)(Java Doc) public LogRecord getLogRecord(Level level, int key, Object arg0, Object arg1, Object arg2)(Code)(Java Doc) public LogRecord getLogRecord(Level level, int key, Object arg0, Object arg1, Object arg2, Object arg3)(Code)(Java Doc) final public String getMenuLabel(int key) throws MissingResourceException(Code)(Java Doc) final public String getString(int key) throws MissingResourceException(Code)(Java Doc) final public String getString(int key, Object arg0) throws MissingResourceException(Code)(Java Doc) final public String getString(int key, Object arg0, Object arg1) throws MissingResourceException(Code)(Java Doc) final public String getString(int key, Object arg0, Object arg1, Object arg2) throws MissingResourceException(Code)(Java Doc) final public String getString(int key, Object arg0, Object arg1, Object arg2, Object arg3) throws MissingResourceException(Code)(Java Doc) final public String getString(int key, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4) throws MissingResourceException(Code)(Java Doc) final protected Object handleGetObject(String key)(Code)(Java Doc) final public void list(Writer out) throws IOException(Code)(Java Doc) public synchronized String toString()(Code)(Java Doc)
|
|
|