protected void generateFromTemplate(TokenValueSet tokens, File template, File destinationFile) throws IOException { LineTokenReplacer replacer = new LineTokenReplacer(tokens, "UTF-8"); replacer.replace(template, destinationFile); }
public TokenReplacementTester(String tokensFileName, String fromFile, String toFile) { final TokenValueSet tokens = getTokensFromFile(tokensFileName); replacer = new LineTokenReplacer(tokens); replacer.replace(fromFile, toFile); }
public TokenReplacementTester(String tokensFileName, String fromFile, String toFile) { final TokenValueSet tokens = getTokensFromFile(tokensFileName); replacer = new LineTokenReplacer(tokens); replacer.replace(fromFile, toFile); }
static void tokenReplaceTemplateAtDestination( Map<String,String> map, String templatePath, String targetPath) { final LineTokenReplacer tr = new LineTokenReplacer(map2Set(map)); tr.replace(templatePath, targetPath); }
/** * Return a man page for this command that has the tokens substituted */ public BufferedReader expandManPage(Reader r) { manpageTokenValues[0] = programOpts.getCommandName(); manpageTokenValues[1] = Environment.getPrefix(); manpageTokenValues[2] = Version.getBriefProductName(); TokenValueSet tvs = new TokenValueSet(); for (int i = 0; i < manpageTokens.length; i++) { tvs.add(new TokenValue(manpageTokens[i], manpageTokenValues[i], "{", "}")); } return new BufferedReader(new LineTokenReplacer(tvs).getReader(r)); }