B.3. BeanShell CommandsBeanShell comes with a number of useful built-in commands in the form of Java methods. These commands are implemented as BeanShell scripts, and are supplied in the bsh JAR file. You can make your own commands by defining methods in your own scripts or adding them to your classpath. See the BeanShell user's manual for more information. One important BeanShell command is print( ), which displays values. print( ) does pretty much the same thing as System.out.println( ) except it ensures the output always goes to the command line (if you have multiple windows open). print( ) also displays some types of objects (such as arrays) more verbosely than Java would. Another very useful command is show( ), which toggles on and off automatic printing of the result of every line you type. (You can turn this on if you want to see every result value.) Here are a few other examples of BeanShell commands:
See the BeanShell user's manual for a full list of commands. |