/**
* Generate a script.
*/
public void createScript(PrintWriter pWriter, Operation pOp, Properties pProps) {
ScriptGenerator sg = iScriptGenerator;
if (sg == null) {
sg = iDefaultScriptGenerator;
}
// add command as a property
StringBuilder builder = new StringBuilder();
for (String token:getCommand()) {
builder.append(token).append(' ');
}
pProps.setProperty("im4java.cmd",builder.toString());
// add search-paths as properties
String globalPath=getGlobalSearchPath();
if (globalPath==null) {
globalPath="";
}
String localPath=getSearchPath();
if (localPath==null) {
localPath="";
}
pProps.setProperty("im4java.globalSearchPath",globalPath);
pProps.setProperty("im4java.localSearchPath",localPath);
sg.init(pWriter,pOp,pProps);
sg.createScript();
}