com.sforce.ws.template
Class Template
java.lang.Object
com.sforce.ws.template.Template
public class Template
- extends Object
This class is used to execute a template. The common usage for this
class is shown below:
Template template = new Template();
//set up implicit variables
template.setProperty("name", value);
String templateFileName = ... //name of the template file
String outputFile = ... //name of the file to the generated
//exec the template
template.exec(templateFileName, outputFile);
- Since:
- 1.0 Nov 22, 2005
- Version:
- 1.0
- Author:
- http://cheenath.com
|
Method Summary |
void |
exec(String in,
String out)
execute the specified template and generate the specified output file. |
void |
setProperty(String name,
Object value)
sets up implicit variable for the script. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Template
public Template()
setProperty
public void setProperty(String name,
Object value)
- sets up implicit variable for the script. You can use this variable from the script.
You can also invoke methods associated with the variable.
- Parameters:
name - name of the variablevalue - value of the variable.
exec
public void exec(String in,
String out)
throws IOException,
TemplateException
- execute the specified template and generate the specified output file.
- Parameters:
in - name of the template file.out - name of the output file. If null, the output will be redirected to System.out
- Throws:
IOException - failed to read/write file
TemplateException - failed to exec template
Copyright © 2012. All Rights Reserved.