1 5 package xdoclet.modules.externalizer; 6 7 import java.text.MessageFormat ; 8 9 import xjavadoc.*; 10 11 import xdoclet.TemplateSubTask; 12 import xdoclet.XDocletException; 13 14 24 public class PropertiesTranslatorSubTask extends TemplateSubTask 25 { 26 public final static String GENERATED_FILE_NAME = "{0}Translator.java"; 27 private static String DEFAULT_TEMPLATE_FILE = "resources/translator.xdt"; 28 29 30 33 public PropertiesTranslatorSubTask() 34 { 35 setHavingClassTag("msg.bundle"); 37 setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE_FILE)); 38 setDestinationFile(GENERATED_FILE_NAME); 39 40 } 41 42 43 50 protected String getGeneratedFileFileName(XClass clazz) throws XDocletException 51 { 52 String result = MessageFormat.format(getDestinationFile(), new Object []{clazz.getQualifiedName().replace('.', '/')}); 53 54 return result; 55 } 56 57 } 58 | Popular Tags |