New Riders - Jython for Java Programmers
Jython for Java Programmers
Copyright
About the Author
About the Technical Reviewers
Acknowledgments
Tell Us What You Think
Introduction
What Is Jython?
Why Jython?
What You Can Expect from This Book
Additional Resources
Part I: Jython
Chapter 1. Jython Syntax, Statements, and Comments
The Interactive Console
Line Separators and Block Indentation Syntax
Comments
Documentation Strings
Statements
Comparing Jython and Java
Chapter 2. Operators, Types, and Built-In Functions
Identifiers
Jython Data Objects
Operators
Built-Ins
Comparison of Jython Data Types and Java Data Types
Java Types
Chapter 3. Errors and Exceptions
Jython Exceptions
Exception Handling
The raise Statement
Tracebacks
The assert Statement and the __debug__ Variable
The Warnings Framework
Comparing Jython and Java
Chapter 4. User-Defined Functions and Variable Scoping
Defining Functions
Namespaces
Recursion
Built-In Functional Programming Tools
Synchronization
Chapter 5. Modules and Packages
The import Statement
A Comparison of Jython and Java
Python's package.module Hierarchy
Java's package.class Hierarchy
Reloading
Chapter 6. Classes, Instances, and Inheritance
Encapsulation, Abstraction, and Information Hiding
Defining Jython Classes
Jython Class and Instance Attributes
Constructors
Finalizer or Destructor
Inheritance
Method Overloading
Sample Classes
Chapter 7. Advanced Classes
Pre-Existing Class Attributes
Pre-Existing Instance Attributes
Special Methods for General Customization
Dynamic Attribute Access
The Callable Hook—__call__
Special Comparison Methods
Object "Truth"
Emulating Built-In Data Objects
Part II: Jython Internals and Integrating Jython With Java
Chapter 8. Compiling Jython with jythonc
What Is jythonc?
Compiling a Module with jythonc
Paths and Compiled Jython
jythonc Options
Java-Compatible Classes
Chapter 9. Embedding and Extending Jython in Java
Embedding Jython
Embedding the InteractiveInterpreter
Embedding an InteractiveConsole
Extending Jython
Part III: Applications with Jython
Chapter 10. GUI Development
Comparing a Java and Jython GUI
Bean Properties and Events
The pawt Package
Examples
Chapter 11. Database Programming
DBM Files
Serialization
Database Management Systems
JDBC
zxJDBC
Chapter 12. Server-Side Web Programming
Jython Servlet Containers
Defining Simple Servlet Classes
More About GenericServlet
HttpServlet
PyServlet
Cookies
Sessions
Databases and Servlets
JSP
Part 4.htm
Appendix A. Jython Statements and Built-In Functions Quick Reference