public class TextScriptExecutor extends Object implements Closeable, Flushable
This class is a simplified template engine similar to Velocity, but of course less powerful. Nevertheless this executor is generally faster than external template engines and does not require any additional libraries.
Example:
Script:
$rownum;$name;$surname;${email.trim().replaceAll('@','_at_')}
Parameters:
| rownum | name | surname | |
|---|---|---|---|
| 1 | John | G | john@nosuchhost.com |
1;John;G;john_at_nosuchhost.com
PropertiesSubstitutor| Constructor and Description |
|---|
TextScriptExecutor(Writer out,
TextConnectionParameters textParams)
Creates an executor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
execute(Reader reader,
ParametersCallback pc,
AbstractConnection.StatementCounter counter)
Parses a script from read, expands properties and produces the output.
|
void |
flush() |
public TextScriptExecutor(Writer out, TextConnectionParameters textParams)
out - writer for output.textParams - text connection parameters.public void execute(Reader reader, ParametersCallback pc, AbstractConnection.StatementCounter counter)
reader - script content.pc - parameters for substitution.counter - statements counter.public void flush()
throws IOException
flush in interface FlushableIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2006–2019. All rights reserved.