Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.4, 2.0
-
None
-
JDK 1.5, 6
Description
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.List;
public class PrintfTool extends org.apache.velocity.tools.generic.LocaleConfig {
StringWriter output;
PrintWriter printer;
public PrintfTool()
{ output = new StringWriter(); printer = new PrintWriter(output); } // Velocity doesn't support invoking with varargs
private String printf(String format, Object... args)
// Velocity does support invoking with a List of values.
public String printf(String format, List args)
// Since value convenience method
public String printf(String format, Object arg) {
return printf(format, new Object[]
);
}
}