Search in sources :

Example 1 with LineTokenReplacer

use of com.sun.enterprise.admin.util.LineTokenReplacer in project Payara by payara.

the class CLICommand method expandManPage.

/**
 * Return a man page for this command that has the tokens substituted
 * @param r
 * @return
 */
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));
}
Also used : TokenValueSet(com.sun.enterprise.admin.util.TokenValueSet) LineTokenReplacer(com.sun.enterprise.admin.util.LineTokenReplacer) TokenValue(com.sun.enterprise.admin.util.TokenValue)

Example 2 with LineTokenReplacer

use of com.sun.enterprise.admin.util.LineTokenReplacer in project Payara by payara.

the class RepositoryManager method generateFromTemplate.

protected void generateFromTemplate(TokenValueSet tokens, File template, File destinationFile) throws IOException {
    LineTokenReplacer replacer = new LineTokenReplacer(tokens, "UTF-8");
    replacer.replace(template, destinationFile);
}
Also used : LineTokenReplacer(com.sun.enterprise.admin.util.LineTokenReplacer)

Example 3 with LineTokenReplacer

use of com.sun.enterprise.admin.util.LineTokenReplacer in project Payara by payara.

the class ServicesUtils method tokenReplaceTemplateAtDestination.

static void tokenReplaceTemplateAtDestination(Map<String, String> map, String templatePath, String targetPath) {
    final LineTokenReplacer tr = new LineTokenReplacer(map2Set(map));
    tr.replace(templatePath, targetPath);
}
Also used : LineTokenReplacer(com.sun.enterprise.admin.util.LineTokenReplacer)

Aggregations

LineTokenReplacer (com.sun.enterprise.admin.util.LineTokenReplacer)3 TokenValue (com.sun.enterprise.admin.util.TokenValue)1 TokenValueSet (com.sun.enterprise.admin.util.TokenValueSet)1