|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.acsinet_solutions.util.text.TextTemplate
public final class TextTemplate
Class that obtains a customized text from a resource. Velocity template framework is used internally to provide templating facilities. See Apache Velocity web site and documentation for more information on templating using that engine.
| Constructor Summary | |
|---|---|
TextTemplate(java.lang.String template)
Public constructor, from a template. |
|
| Method Summary | |
|---|---|
java.lang.String |
apply(java.util.Map params)
Apply the given parameter map to the template and generate a string value as a result |
void |
apply(java.util.Map params,
java.io.Writer writer)
Apply the given parameter map to the template and write the output to the provided writer |
static TextTemplate |
createTemplateFromInputStream(java.io.InputStream istream)
Create a text template from an input stream |
static TextTemplate |
createTemplateFromResource(java.lang.String resource)
Create a text template from a named resource |
static java.io.Reader |
transform(java.io.InputStream sourceStream,
java.io.InputStream propertiesStream)
In this method sourceStream represents the template source, and propertiesStream represents a properties file that holds the values of the variables that will be passed as the parameter map to the template to perform the substitution. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TextTemplate(java.lang.String template)
| Method Detail |
|---|
public static final TextTemplate createTemplateFromResource(java.lang.String resource)
throws java.io.IOException
resource - The not-null valid resource name
java.io.IOException
public static final TextTemplate createTemplateFromInputStream(java.io.InputStream istream)
throws java.io.IOException
istream - A not-null valid InputStream instance
java.io.IOException
public static final java.io.Reader transform(java.io.InputStream sourceStream,
java.io.InputStream propertiesStream)
throws java.io.IOException,
EvaluationException
java.io.IOException
EvaluationException
public final java.lang.String apply(java.util.Map params)
throws EvaluationException
Map - a named map of values
EvaluationException
public final void apply(java.util.Map params,
java.io.Writer writer)
throws EvaluationException
EvaluationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||