1 15 package org.apache.tapestry.util; 16 17 import java.util.MissingResourceException ; 18 import java.util.ResourceBundle ; 19 20 import org.apache.tapestry.engine.IPropertySource; 21 22 29 30 public class ResourceBundlePropertySource implements IPropertySource 31 { 32 private ResourceBundle _bundle; 33 34 public ResourceBundlePropertySource(ResourceBundle bundle) 35 { 36 _bundle = bundle; 37 } 38 39 47 48 public String getPropertyValue(String propertyName) 49 { 50 try 51 { 52 return _bundle.getString(propertyName); 53 } 54 catch (MissingResourceException ex) 55 { 56 return null; 57 } 58 } 59 60 } 61 | Popular Tags |