Package org.apache.batik.util.resources
Class ResourceManager
- java.lang.Object
-
- org.apache.batik.util.resources.ResourceManager
-
- Direct Known Subclasses:
ButtonFactory,MenuFactory,ToolBarFactory
public class ResourceManager extends java.lang.ObjectThis class offers convenience methods to decode resource bundle entries- Version:
- $Id: ResourceManager.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ResourceBundlebundleThe managed resource bundle
-
Constructor Summary
Constructors Constructor Description ResourceManager(java.util.ResourceBundle rb)Creates a new resource manager
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetBoolean(java.lang.String key)Returns the boolean mapped with the given keyintgetCharacter(java.lang.String key)intgetInteger(java.lang.String key)Returns the integer mapped with the given stringjava.lang.StringgetString(java.lang.String key)Returns the string that is mapped with the given keyjava.util.ListgetStringList(java.lang.String key)Returns the tokens that compose the string mapped with the given key.java.util.ListgetStringList(java.lang.String key, java.lang.String delim)Returns the tokens that compose the string mapped with the given key.java.util.ListgetStringList(java.lang.String key, java.lang.String delim, boolean returnDelims)Returns the tokens that compose the string mapped with the given key
-
-
-
Method Detail
-
getString
public java.lang.String getString(java.lang.String key) throws java.util.MissingResourceExceptionReturns the string that is mapped with the given key- Parameters:
key- a key in the resource bundle- Throws:
java.util.MissingResourceException- if key is not the name of a resource
-
getStringList
public java.util.List getStringList(java.lang.String key) throws java.util.MissingResourceExceptionReturns the tokens that compose the string mapped with the given key. Delimiters (" \t\n\r\f") are not returned.- Parameters:
key- a key of the resource bundle- Throws:
java.util.MissingResourceException- if key is not the name of a resource
-
getStringList
public java.util.List getStringList(java.lang.String key, java.lang.String delim) throws java.util.MissingResourceExceptionReturns the tokens that compose the string mapped with the given key. Delimiters are not returned.- Parameters:
key- a key of the resource bundledelim- the delimiters of the tokens- Throws:
java.util.MissingResourceException- if key is not the name of a resource
-
getStringList
public java.util.List getStringList(java.lang.String key, java.lang.String delim, boolean returnDelims) throws java.util.MissingResourceExceptionReturns the tokens that compose the string mapped with the given key- Parameters:
key- a key of the resource bundledelim- the delimiters of the tokensreturnDelims- if true, the delimiters are returned in the list- Throws:
java.util.MissingResourceException- if key is not the name of a resource
-
getBoolean
public boolean getBoolean(java.lang.String key) throws java.util.MissingResourceException, ResourceFormatExceptionReturns the boolean mapped with the given key- Parameters:
key- a key of the resource bundle- Throws:
java.util.MissingResourceException- if key is not the name of a resourceResourceFormatException- if the resource is malformed
-
getInteger
public int getInteger(java.lang.String key) throws java.util.MissingResourceException, ResourceFormatExceptionReturns the integer mapped with the given string- Parameters:
key- a key of the resource bundle- Throws:
java.util.MissingResourceException- if key is not the name of a resourceResourceFormatException- if the resource is malformed
-
getCharacter
public int getCharacter(java.lang.String key) throws java.util.MissingResourceException, ResourceFormatException- Throws:
java.util.MissingResourceExceptionResourceFormatException
-
-