|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.stratelia.webactiv.util.ResourceLocator
public class ResourceLocator
Constructor Summary | |
---|---|
ResourceLocator()
Creates new ResourceLocator |
|
ResourceLocator(String sPropertyFile,
Locale sLocale)
Deprecated. |
|
ResourceLocator(String propertyFile,
String language)
Create a resource locator with the given property file (Ex: com.stratelia.webactiv.util.util) Use the function getString to get the parameters from this instance |
|
ResourceLocator(String propertyFile,
String language,
ResourceLocator defaultResource)
|
Method Summary | |
---|---|
boolean |
getBoolean(String sAttribut,
boolean defaultValue)
Return the value of the given attribut in the Property created with the ResourceLocator constructor |
float |
getFloat(String sAttribute,
float defaultValue)
Gets the value as a float of the specified attributes in the resource bundle located by this ResourceLocator. |
int |
getInteger(String sAttribute,
int defaultValue)
Gets the value as an integer of the specified attributes in the resource bundle located by this ResourceLocator. |
Enumeration<String> |
getKeys()
Return an enumeration of all keys in the property file loaded |
String |
getLanguage()
|
long |
getLong(String sAttribute,
long defaultValue)
Gets the value as a long of the specified attributes in the resource bundle located by this ResourceLocator. |
Properties |
getProperties()
Return the properties * |
static URL |
getResource(Object object,
Locale loc,
String configFile,
String extension)
|
static InputStream |
getResourceAsStream(Object object,
Locale loc,
String configFile,
String extension)
|
ResourceBundle |
getResourceBundle()
|
String |
getString(String sAttribut)
Return the value of the given attribut in the Property created with the ResourceLocator constructor |
String |
getString(String sAttribut,
String defaultValue)
Return the value of the given attribut in the Property created with the ResourceLocator constructor |
String[] |
getStringArray(String propNamePrefix,
String propNameSufix,
int max)
Read a String-List from a Settings-file with indexes from 1 to n If max is -1, the functions reads until the propertie's Id is not found. |
String |
getStringWithParam(String resName,
String param)
|
String |
getStringWithParams(String resName,
String[] params)
|
static void |
resetResourceLocator()
|
void |
setLanguage(String sLanguage)
Switchs this resource locator to the specified language for the same refered property file. |
void |
setPropertyLocation(String sPropertyFile,
String sLanguage)
Set properties of a SilverPeas component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourceLocator()
public ResourceLocator(String propertyFile, String language)
propertyFile
- language
- public ResourceLocator(String propertyFile, String language, ResourceLocator defaultResource)
public ResourceLocator(String sPropertyFile, Locale sLocale)
Method Detail |
---|
public void setPropertyLocation(String sPropertyFile, String sLanguage)
sPropertyFile
- sLanguage
- public void setLanguage(String sLanguage)
sLanguage
- the language to use for getting property values.public String getString(String sAttribut)
sAttribut
-
public String getString(String sAttribut, String defaultValue)
sAttribut
- defaultValue
-
public boolean getBoolean(String sAttribut, boolean defaultValue)
sAttribut
- defaultValue
-
public long getLong(String sAttribute, long defaultValue)
sAttribute
- the attribute to look up in the resource bundle.defaultValue
- the default value to return wether no such property exists in the resource
bundle.
public float getFloat(String sAttribute, float defaultValue)
sAttribute
- the attribute to look up in the resource bundle.defaultValue
- the default value to return wether no such property exists in the resource
bundle.
public int getInteger(String sAttribute, int defaultValue)
sAttribute
- the attribute to look up in the resource bundle.defaultValue
- the default value to return wether no such property exists in the resource
bundle.
public String getStringWithParam(String resName, String param)
public String getStringWithParams(String resName, String[] params)
public String[] getStringArray(String propNamePrefix, String propNameSufix, int max)
propNamePrefix
- propNameSufix
- max
- the maximum index (-1 for no maximum value)
public Enumeration<String> getKeys()
public ResourceBundle getResourceBundle()
public Properties getProperties()
public String getLanguage()
public static void resetResourceLocator()
public static URL getResource(Object object, Locale loc, String configFile, String extension)
public static InputStream getResourceAsStream(Object object, Locale loc, String configFile, String extension)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |