Apache Jakarta and Beyond: A Java Programmeramp;#039;s Introduction [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Apache Jakarta and Beyond: A Java Programmeramp;#039;s Introduction [Electronic resources] - نسخه متنی

Larne Pekowsky

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید







16.1. Running BeanShell


BeanShell started as a scripting language with a Java-like syntax, although it has recently been expanded to be completely Java-compatible. This new functionality will be discussed shortly.

BeanShell may be used in two ways: as an application or as an API. Although the language itself is the same in either case, the principles are best demonstrated in application mode.

Within application mode BeanShell may be run either within a console or in its own Swing-based window. The latter may be invoked by adding bsh.jar to the CLASSPATH, and running


java bsh.Console

This will bring up the window shown in Figure 16.1.


Figure 16.1. The BeanShell GUI.

Chapter 3. This view is shown in Figure 16.2.


Figure 16.2. The BeanShell class browser.

[View full size image]

This works in the obvious way: a hierarchy can be clicked to display a list of classes, and a class may be clicked to bring up a list of methods.

The console version of BeanShell is started as


java bsh.Interpreter

This will present a prompt much like a single workspace, except that the arrow keys will not work. The interpreter may also be given the name of a file containing BeanShell expressions and commands. It will evaluate these expressions in order and then exit.


/ 207