- Timestamp:
- Apr 20, 2010, 5:21:42 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/PropertyBundle.java
r858 r865 6 6 import java.util.ResourceBundle; 7 7 import javax.faces.context.FacesContext; 8 8 /** 9 * Class containing the methods used to access the messages property bundle 10 * @author tgoecke 11 * 12 */ 9 13 public class PropertyBundle{ 10 14 11 15 private static ResourceBundle properties; 12 16 private static final String path = "de.dass_it.vanhelsing.gui.messages"; 13 17 /** 18 * reads the messages property file 19 */ 14 20 private static void initialize(){ 15 21 Locale l = FacesContext.getCurrentInstance().getViewRoot().getLocale(); … … 20 26 properties = ResourceBundle.getBundle(path, l); 21 27 } 28 /** 29 * method returns a single value of a given key 30 * @param key key of 31 * @return value of the property identified by key. If an exception is thrown, null will be returned 32 */ 22 33 public static String getProperty(String key){ 23 34 try{ … … 32 43 return null; 33 44 } 45 /** 46 * method to retrieve properties with a partial key. a partial key is the first n characters of a key 47 * 48 * @param partialKey first n characters of a property key 49 * @return an array of values whose keys started with partialKey. an empty array is returned if no matchings have been found 50 */ 34 51 public static String[] getTypeProperties(String partialKey){ 35 52 Enumeration<String> keySet = properties.getKeys(); … … 45 62 } 46 63 result.trimToSize(); 64 if (result.size()>0) return (String[]) result.toArray(); 47 65 return result.toArray(new String[0]); 48 66 }
Note:
See TracChangeset
for help on using the changeset viewer.