我正在研究Rhino脚本以运行Oracle Data Modeler工具,有时我需要从这些脚本中获取简单的输出,例如对象列表(实体,表格等)以及有关它们的一些数据。
我该怎么做?
答案 0 :(得分:0)
可以使用的一种技术是创建一个Note对象,并使用此函数用一些任意文本更新音符内容。
var print = (function() {
var notes = model.getNoteSet().toArray();
var note = null;
if (notes.length > 0) {
note = notes[0];
note.comment = "";
}
return function() {
if (note != null) {
var s = String(note.comment);
for (var i = 0; i < arguments.length; i++) {
s += arguments[i];
}
note.comment = s;
}
}
})();
你可以这样使用它:
print("This ", "is ", "a test", "\n");
我知道我可以使用java API来打开文本文件或类似内容,但更新注释内容对我来说似乎更简单。