| 0. Preface |
Part I. Introduction |
1.
Introduction to Judo |
Background |
|
Judo, a Functional Java Scripting Language |
|
The Java Platform and Scripting Languages |
|
Vive les Scripting Languages! |
|
Programming Language Design |
|
Judo 0.9, 1.0 and ECMAScript |
Components of Judo Language |
|
Core Programming Language |
|
Java Scripting |
|
Built-In Data Structures |
|
System Functions |
|
Functional Support |
Uses of Judo |
|
Enterprise Uses |
|
Software Development Uses |
|
Daily Uses |
Who Can Use Judo |
How to Run Java Software and Judo |
|
Install Java and Run Java Software |
|
Install and Run Judo |
How This Book is Organized |
Conventions and Terminologies Used in This Book |
2.
Major Use Cases Illustrated |
General Programming Use Cases |
|
Branching |
|
For Loop |
|
While Loop |
Java Scripting Use Cases |
Dynamic Evaluation Use Cases |
OS and Shell Use Cases |
File System and Archive Use Cases |
Internet Use Cases |
JDBC Scripting Use Cases |
Hibernate Scripting Use Cases |
SGML Use Cases |
XML Use Cases |
Windows Use Cases |
Server-Side Scripting Use Cases |
Embed-In-Java Use Cases |
Part II. Core Language Programming |
3.
Basic Program Structure |
Lexical Structure |
|
Identifiers, Variable and Constants |
|
Reserved Words |
|
Comments |
Variables and Scopes |
Constants |
|
Predefined Constants |
4.
Running Judo and Logging |
Start-Up Environment |
Classpath |
|
Java Class Constants |
System Properties and Environment Variables |
Include Other Scripts |
Pragma |
Make Scripts Executable |
|
Make Scripts Executable on Windows |
|
Make Scripts Executable on Unix |
Logging |
|
Judo Logging Sources and Logging Pragma |
|
Non-Judo Logging Sources |
|
Logging with Log4J and JDK 1.4 Logging API |
Program Documentation |
5.
Basic Data Types and Expressions |
Null and Undefined |
Boolean and Numbers |
String and Character |
File Names and URLs |
Regular Expression |
|
The Java/Judo Regular Expressions |
|
Use Regular Expressions in Judo |
Date and Time |
Secret |
6.
Flow Control |
Basic Flow Control Statements |
|
Types of Judo Statements |
|
If-Else Statement |
|
Switch Statement |
|
While and Do-While Loops |
|
For and Repeat Loops |
|
Break, Continue and Loop Index |
Functions and Function Variables |
|
Function Parameters |
|
Dynamic Function Parameters |
|
Function Variables |
|
Anonymous Functions |
|
Function Alias for Java Static Methods |
|
System Functions |
Exception Handling |
|
The Exception Object |
|
The Throw and Resume Statements |
7.
Built-In Data Structures |
Array and Linked List |
Object and Ordered Map |
Tree Node |
Set and Ordered Set |
Stack and Queue |
Table Data |
8.
Threads and Dynamic Evaluation |
Runtime Context |
Thread Programming |
Execute Dynamic and External Scripts |
10.
Object-Oriented Programming |
Define A New Class |
Constructor and Initialization |
Derive A New Class From Others |
Transpose Class Instances |
11.
Java Scripting |
Introduction to Java and Object Scripting |
Use Java Objects and Classes |
|
Create and Use Java Objects |
|
Resolving Java Class Names |
|
Pass Judo Values To Java Methods |
|
Use Java Classes and Class Static Members |
|
Alias Java Static Methods as Functions |
Create and Use Java Arrays |
Native Judo Operations for Java Data Structures |
|
Initialize and Access java.util.Map Values |
|
Iterate Java Data Structures and Objects |
|
Access elements in java.util.List |
Extend Java Classes and Implement Java Interfaces |
Java Interface Adapters |
Making Clients for JNDI, RMI and EJB |
|
Obtain JNDI Initial Context |
|
RMI |
Java Software Testing and JUnit |
Java Software Prototyping |
Thread and Other Considerations |
Summary |
Part III. Essential Services and Shell Scripting |
14.
Print, File I/O and In-Script Data |
Print and Formatting |
|
Printing |
|
Print Into Variables |
|
Using System Input and Output Streams |
Read and Write Binary Files |
|
Read and Write Binary Files Sequentially |
|
Random Access Files |
Read and Write Files Within Zip Files |
In-Script Data |
15.
File System and Archives |
Working in the File System |
|
The Current Directory and Change Directory |
|
Make and Remove Directory |
|
Rename and Move Files |
List and Process Files |
|
File Selection |
|
Obtain Selected Files in a List or a Tree |
|
Count Files and Directories |
|
Get Statistics about Files |
|
Summary of listFiles Return Values |
|
Remove and Set Attributes on Selected Files |
|
Run Shell Commands on Selected Files |
|
Arbitrarily Process Selected Files |
|
List Files and Get Information in Archives |
|
Process Files in Zip Archives |
Copy and Archive Files |
|
Copy a Single File to a Different Name |
|
Copy Files to a Different Location |
|
Copy Files into Archives |
|
Save Multiple File Sets into a Single Archive |
|
Copy Public Internet Resources |
Other File Utilities |
|
Encrypting and Decrypting Files and Data |
|
Chopping and Assembling Files |
16.
Run Executables |
Introduction to Running Native Programs |
The Command-Line Format |
Return Value, Running Modes and Options |
|
Return Value |
|
Synchronous and Asynchronous Runs |
|
Environment Variables |
|
Start-Up Directory |
Process Executable Input And/Or Output |
|
User Input for the Executable |
|
Provide User Input from the Script |
|
Read Executable Output into the Script |
|
Write to and Read from the Executable |
Case Study: Build and Test the Judo Software |
17.
Internet Scripting |
HTTP Client Features |
HTTP Server Features |
Create A HTTP Proxy Server |
UDP and Broadcasting |
Send Mail |
SSH and SCP |
FTP |
18.
Scheduled Jobs |
|
Different Modes of Scheduling |
|
HTTP Console Interface for Schedules |
19.
Java GUI Scripting |
Create AWT and Swing GUIs |
Handle GUI Events |
Handle GUI Events for Multiple Controls |
20.
Ant Scripting and Scripting Ant |
Introduction to Ant |
|
What is Ant? |
|
Ant Build Scripts |
|
Judo and Ant |
Embed Judo in Ant Build Script |
|
The Ant <judoscript> Task |
|
Passing Information between Ant and the <judoscript> Tag |
|
Call Other Ant Targets and Access Other Resources |
Script Ant Tasks |
|
Passing Information between code and Ant tasks |
|
Handle Ant task execution failures |
|
When and why to script Ant tasks in Judo |
21.
Internalization and Localization |
Text Encoding in Judo and Java |
|
Text Encoding |
|
Read and Write Files in Native Languages |
Handle Native Language Contents on the Internet |
Native Language Text in Source Code |
|
Turn Characters into Unicode Escape Sequences |
|
Use Native Characters Directly in Source Code |
View and Edit Native Language Content |
|
A Poor Man's Native Language Viewer |
|
A Poor Man's Native Language Editor |
Use Locales |
Part IV. Advanced Data Processing and Applications |
22.
JDBC (SQL) Scripting |
Introduction to JDBC Scripting |
|
Java, JDBC and RDBMS |
|
SQL, JDBC and JDK Versions |
|
JDBC SQL Data Types |
|
JDBC and ODBC |
|
SQL/JDBC Scripting in Judo |
Connections and Drivers |
|
JDBC Drivers |
|
Connection Attributes |
Direct and Batch Execution of SQL |
|
Run SQL Directly |
|
Run Raw SQL and Database Language Scripts |
|
Run SQL in Batches |
Run SQL Script Files |
Parameterized SQL |
Run SQL Update Statements |
Queries and Query Results |
Execute Database Scripts As-Is |
Call Stored Procedures |
Use Advanced SQL Types |
Database Meta-Information and Utilities |
23.
JDBC (SQL) Scripting - Work with RDBMSs |
Use HSQLDB |
Use Oracle |
Use IBM DB2 |
Use Microsoft SQL Server |
Use MySQL |
24.
Hibernate ORM and HQL Scripting |
Introduction to Hibernate and HQL |
|
A Simple Example of Object Mapping |
|
Key Hibernate API Classes and Interfaces |
|
Set-Up and Initialization of Hibernate |
|
Hibernate Scripting |
|
Set-Up and Initialization of Hibernate |
|
Support for Object Persistence and Transactions |
|
Support for HQL and Multiple Object Deletion |
Working with Hibernate Object Models |
|
Mapping Types |
|
Mapping Entity and Value Types |
|
Mapping Class Inheritance |
|
Mapping Associations |
Summary |
25.
SGML and JSP Scraping |
SGML/HTML Scraping Made Easy |
SGML Scripting Versus XML Scripting |
JSP Scraping and Build Template Systems |
Develop Your Own Tag System for Information Organization |
Case Study: An SGML-Based Documentation System |
|
Planning for SGML-Based Documentation |
|
Develop An SGML-Based Documentation System |
26.
XML Scripting - SAX Style |
Introduction to XML Document Processing |
SAX-Style XML scripting |
DOM Programming |
XSLT Scripting |
27.
XML Scripting - DOM Style |
|
Native XML Scripting |
28.
SOAP Web Service Scripting |
Introduction to SOAP Web Services |
|
SOAP Web Services |
|
WSDL |
|
Data Types and Encoding |
|
Web Service Clients |
SOAP Web Service Scripting |
|
Prerequisite |
|
Start Scripting Web Services |
Parameters and Return Values |
|
Set Up the Echo Sample Web Service |
|
Built-In Data Types |
|
Custom Data Types |
|
Input/Output Parameters and Return Values |
|
Different Input Types for Maps and Structs |
|
Summary of SOAP Web Service Scripting |
29.
Scripting for Windows |
30.
Microsoft ActiveX Scripting |
Microsoft ActiveX/COM Background |
|
Introduction to COM and ActiveX |
|
IDispatch |
|
IEnumVARIANT |
|
Type Library |
|
Introduction to ActiveX Control |
|
ActiveX Control Data Types |
|
ActiveX Control Methods and Properites |
|
ActiveX Control Events |
ActiveX and Java |
|
Scripting ActiveX Controls with Java |
|
Thoughts about COM/ActiveX, Java and Platforms |
Scripting ActiveX Controls with Judo |
|
Obtain ActiveX Controls |
|
Access ActiveX Control Properties |
|
Invoke ActiveX Control Methods |
|
Control the Reference Counts |
|
Use the IEnumVARIANT Interface |
Use ADO to Access Databases |
31.
Use Microsoft Office Products |
Use Microsoft Excel |
Use Microsoft Word |
Use Microsoft Internet Explorer |
Use Microsoft Outlook |
Part V. Beyond Basics |
32.
JuSP: the Judo Server Page Technology |
|
The JuSP Platform |
33.
Embed Judo in Java Software |
The Easy Way to Embed Judo in Java Software |
|
Default Function Name in the Embedded Script |
|
Capture and Redirect Output |
|
Syntax and Runtime Error Reporting |
Introduction to Bean Scripting Framework (BSF) |
BSF Support for Judo |
Use Judo Inside Ant Through BSF |
34.
Extending Judo |
|
Establish Your Own System Functions |
|
Build Libraries for Java and Judo |
|
Introduction to Judo Internals |
|
Judo Debug Interface (JUDI) |
|
Judo Profile Interface (JUPI) |
35.
Judo Tools and Special Usages |
|
Judo Precompiler |
|
Judo-Java Translator |
|
JUSP Preprocessor |
|
White-Box Java Unit Testing |
|
Protect Passwords In The Scripts |
Part VI. Judo Language Reference |
I.
Functional Areas |
II.
Grammar |
III.
Built-In System Functions |
IV.
Built-In Object Types |