|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.nuxeo.launcher.commons.text.TextTemplate
public class TextTemplate
Text template processing.
Copy files or directories replacing parameters matching pattern
'${[a-zA-Z_0-9\-\.]+}' with values from a Map
(deprecated) or a
Properties
.
Method setParsingExtensions(String)
allow to set list of files being
processed when using processDirectory(File, File)
or #pro, others
are simply copied.
Constructor Summary | |
---|---|
TextTemplate()
|
|
TextTemplate(Map<String,String> vars)
Deprecated. prefer use of TextTemplate(Properties) |
|
TextTemplate(Properties vars)
|
Method Summary | |
---|---|
String |
getVariable(String name)
|
Properties |
getVariables()
|
boolean |
isTrim()
|
String |
process(CharSequence text)
|
String |
process(InputStream in)
|
void |
process(InputStream in,
OutputStream out)
|
void |
process(InputStream is,
OutputStream os,
boolean processText)
|
void |
processDirectory(File in,
File out)
Recursive call process(InputStream, OutputStream, boolean) on
each file from "in" directory to "out" directory. |
void |
setParsingExtensions(String extensionsList)
|
void |
setTrim(boolean trim)
Set to true in order to trim invisible characters (spaces) from values. |
void |
setVariable(String name,
String value)
|
void |
setVariables(Map<String,String> vars)
Deprecated. prefer use of getVariables() then Properties
.load() |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextTemplate()
@Deprecated public TextTemplate(Map<String,String> vars)
TextTemplate(Properties)
public TextTemplate(Properties vars)
vars
- Properties containing keys and values for template processingMethod Detail |
---|
public boolean isTrim()
public void setTrim(boolean trim)
@Deprecated public void setVariables(Map<String,String> vars)
getVariables()
then Properties
.load()
public void setVariable(String name, String value)
public String getVariable(String name)
public Properties getVariables()
public String process(CharSequence text)
public String process(InputStream in) throws IOException
IOException
public void process(InputStream in, OutputStream out) throws IOException
IOException
public void processDirectory(File in, File out) throws FileNotFoundException, IOException
process(InputStream, OutputStream, boolean)
on
each file from "in" directory to "out" directory.
in
- Directory to read files fromout
- Directory to write files to
FileNotFoundException
IOException
public void process(InputStream is, OutputStream os, boolean processText) throws IOException
processText
- if true, text is processed for parameters replacement
IOException
public void setParsingExtensions(String extensionsList)
extensionsList
- comma-separated list of files extensions to parse
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |