1 5 package xdoclet.tagshandler; 6 7 import java.util.Properties ; 8 9 import xdoclet.XDocletException; 10 import xdoclet.XDocletTagSupport; 11 import xdoclet.util.DocletUtil; 12 import xdoclet.util.Translator; 13 14 23 public class TranslatorTagsHandler extends XDocletTagSupport 24 { 25 43 public String getString(Properties attributes) throws XDocletException 44 { 45 String bundleKey = attributes.getProperty("bundle"); 46 String resourceKey = attributes.getProperty("resource"); 47 String argumentsStr = attributes.getProperty("arguments"); 48 String delimiter = attributes.getProperty("delimiter"); 49 50 String [] arguments = null; 51 52 if (argumentsStr != null) { 53 if (delimiter == null) { 54 delimiter = PARAMETER_DELIMITER; 55 } 56 57 arguments = DocletUtil.tokenizeDelimitedToArray(argumentsStr, delimiter); 58 } 59 if (bundleKey == null) { 60 bundleKey = "xdoclet.XDocletMessages"; 61 } 62 63 return Translator.getString(bundleKey + "Messages", resourceKey, arguments); 64 } 65 66 } 67 | Popular Tags |