Beanshell翻译10

上一篇 / 下一篇  2008-09-02 20:21:24 / 个人分类:Beanshell

Beanshell翻译10

http://user.qzone.qq.com/281696143/blog/1218006867  Ronger
1.Special Variables and Values 特殊的变量和值
In addition to the scope modifiers: 'this', 'super', 'global',
BeanShell supports a number of pre.defined system variables, "magic" values, and methods.
为了增加作用域的使用:'this','super','global',
Beanshell提供一些提前定义好的系统变量,"magic"值,和方法。
Special Values 特殊值
· $_ . The value of the last expression evaluated.
The strange construct for this is drawn from Perl,
but the idea exists in many scrīpting languages.
It is useful for getting back the last result when you are working interactively.
$_最后一个表达式。
这个奇怪的构造是从perl中过来的,但是这个创意存在于很多脚本语言中。
当你在交互式的运行的时候,在取到最后的结果上面它是很有用的。
· $_e . The last uncaught exception object thrown.
This is useful in interactive use for retrieving the last exception to inspect it for details.
最后一个没有捕获的异常对象
在交互式使用中去检查它得细节而重新取得最后一个异常,它是有用的,
· bsh . The BeanShell root system object, containing system information and variables.
Beanshell根系统对象,包含系统信息和变量。
· bsh.args . An array of Strings passed as command line arguments to the BeanShell interpreter.
通过命令行参数到Beanshell解释器得到的一个字符串数组。
· bsh.shared . A special static space which is shared across all interpreter instances.
Normally each bsh.Interpreter instance is entirely independent;
having its own unique global namespace and settings.
bsh.shared is implemented as a static namespace in the bsh.Interpreter class.
It was added primarily to support communication among instances for the GUI desktop.
一个特殊的静态空间,和所有的解释器实例共享。
正常的每个bsh.Interpreter实例是完全独立的;
有他们自己单独的全局名字空间和设置。
在bsh.Interpreter类中,bsh.shared是作为一个静态的名字空间实现的。
它最初加进来是为了,支持实例和GUI平台之间的通信。
· bsh.console . If BeanShell is running in its GUI desktop mode,
this variable holds a reference to the current interpreter's console, if it has one.
如果Beanshell运行在它的桌面模式,这个变量保存一个引用指向当前的解释器控制台,
当然它只有一个。
· bsh.appletcontext . If BeanShell is running inside an Applet,
the current applet context, if one exists.
如果Beanshell运行在一个Applet中,就是指这个当前的applet环境。
· bsh.cwd . A String representing the current working directory of the BeanShell interpreter.
This is used or manipulated by the cd(), dir(), pwd(), and pathToFile() commands.
一个字符串,直接为Beanshell解释器工作的,
这些是被使用或者是通过cd(),dir(),pwd(),pathToFile()命令来操作。
· bsh.show . A boolean value used by the show() command.
It indicates whether results are always printed, for interactive use.
用在show()命令中的布尔值,它表示结果是否要被打印,在交互使用中。
· bsh.interactive .
A boolean indicating whether this interpreter running in an interactive mode。
一个布尔值,表示解释器是否运行在一个交互模式下。
· bsh.evalOnly .
A boolean indicating whether this interpreter has an input stream or whether is it only
serving as an engine for eval() operations (e.g. for embedded use).
一个布尔值,表示解释器是否有一个输入流,
或者它作为一个引擎仅仅是为eval()操作服务的。
Note: 提示:
The choice of "bsh" for the root system object name was somewhat unfortunate
because it conflicts with the current package name for BeanShell (also bsh).
This means that if you wish to work with BeanShell classes explicitly from BeanShell scrīpts
(e.g. bsh.Interpreter)
you must first import them, e.g.:
对于系统根对象名来说,"bsh"的选择在有些情况下不太好。
因为它对Beanshell来说避免了当前的包名。
这些表明了,如果你希望和Beanshell中的类一起工作,你必须首先导入他们。
import bsh.Interpreter;
i=new Interpreter();
2.Special Members of 'this' type References 'this'类型引用的特别属性
'this' type references have several "magic" members: 'this'类型引用有几类"magic"属性
· this.variables .
An array of Strings listing the variables defined in the current method context(namespace).
一个字符串数组列出了定义在当前函数环境(名字空间)的变量。
· this.methods .
An array of Strings listing the methods defined the current method context(namespace).
一个字符串数组列出了定义在当前函数环境(名字空间)的变量。
· this.interpreter .
A bsh.Interpreter reference to the currently executing BeanShell Interpreter object.
bsh.Interpreter引用指向当前执行的Beanshell解释器对象。
· this.namespace .
A bsh.NameSpace reference to the BeanShell NameSpace object of the current method context.
See "Advanced Topics".
bsh.NameSpace引用指向Beanshell当前函数环境名字空间对象。请看"高级话题"。
· this.caller .
A bsh.This reference to the calling BeanShell method context.
See "Variables and Scope Modifiers".
bsh.This引用指向Beanshell函数环境。请看"变量和作用域修改"。
· this.callstack .
An array of bsh.NameSpace references representing the "call stack" up to the current method context.
See "Advanced Topics".
一个bsh.NameSpace引用数组表示,"call stack"指向当前函数环境。请看"高级话题"。
These magic references are primarily used by BeanShell commands.
这些魔术引用是最初使用在Beansehll命令中。


相关阅读:

TAG: Beanshell

引用 删除 wanglihua604   /   2008-09-25 17:52:44
能不能具体说一下,BeanShell在什么情况下使用,我刚刚开始学习,还不太清楚是怎么回事,我应该怎么学习这个东西更快点?
谢谢............
 

评分:0

我来说两句

日历

« 2024-04-14  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 25830
  • 日志数: 25
  • 建立时间: 2008-08-27
  • 更新时间: 2008-09-02

RSS订阅

Open Toolbar