1 2 24 package org.enhydra.tool.codegen; 25 26 import org.enhydra.tool.common.ReplacementSet; 28 import org.enhydra.tool.common.Replacement; 29 import org.enhydra.tool.common.ToolException; 30 import java.io.File ; 32 import java.util.Calendar ; 33 34 38 public class ProjectReplacementSet extends ReplacementSet implements Constants { 39 40 44 public static final String at_PROJECT_at = "at_PROJECT_at"; 46 49 public static final String at_PACKAGE_DIR_at = 50 "at_PACKAGE_DIR_at"; 52 55 public static final String JAVA_PACKAGE = "@JAVA_PACKAGE@"; 57 60 public static final String SHELL_PACKAGE_DIR = 61 "@SHELL_PACKAGE_DIR@"; 63 66 public static final String SHELL_ROOT_PATH = "@SHELL_ROOT_PATH@"; 68 71 public static final String COPYRIGHT = "@COPYRIGHT@"; 73 76 public static final String at_YEAR_at = "at_YEAR_at"; 78 83 public ProjectReplacementSet() { 84 Calendar cal = Calendar.getInstance(); 85 try { 86 this.add(new Replacement(ProjectReplacementSet.at_PROJECT_at, 87 ProjectReplacementSet.at_PROJECT_at)); 88 this.add(new Replacement(ProjectReplacementSet.at_PACKAGE_DIR_at, 89 ProjectReplacementSet.at_PACKAGE_DIR_at)); 90 this.add(new Replacement(ProjectReplacementSet.JAVA_PACKAGE, 91 ProjectReplacementSet.JAVA_PACKAGE)); 92 this.add(new Replacement(ProjectReplacementSet.SHELL_PACKAGE_DIR, 93 ProjectReplacementSet.SHELL_PACKAGE_DIR)); 94 this.add(new Replacement(ProjectReplacementSet.SHELL_ROOT_PATH, 95 ProjectReplacementSet.SHELL_ROOT_PATH)); 96 this.add(new Replacement(ProjectReplacementSet.COPYRIGHT, 97 new String ())); 98 this.add(new Replacement(ProjectReplacementSet.at_YEAR_at, 99 Integer.toString(cal.get(Calendar.YEAR)))); 100 } catch (ToolException e) { 101 e.printStackTrace(); 102 } 103 } 104 105 } 106 | Popular Tags |