1 15 package org.apache.tapestry.services.impl; 16 17 import java.text.MessageFormat ; 18 import java.util.Locale ; 19 import java.util.Properties ; 20 21 import org.apache.hivemind.Messages; 22 import org.apache.hivemind.impl.AbstractMessages; 23 import org.apache.hivemind.util.Defense; 24 25 33 34 public class ComponentMessages extends AbstractMessages 35 { 36 private final Properties _properties; 37 38 private final Locale _locale; 39 40 public ComponentMessages(Locale locale, Properties properties) 41 { 42 Defense.notNull(locale, "locale"); 43 Defense.notNull(properties, "properties"); 44 45 _locale = locale; 46 _properties = properties; 47 } 48 49 protected String findMessage(String key) 50 { 51 return _properties.getProperty(key); 52 } 53 54 protected Locale getLocale() 55 { 56 return _locale; 57 } 58 } | Popular Tags |