You are previewing Java 6™ New Features: A Tutorial.
O'Reilly logo
Java 6™ New Features: A Tutorial

Book Description

For seasoned Java programmers who want to stay up to date on the latest Java tools, this guide discusses the new features of Java 6–Mustang. This handbook to the new version includes updated information on Web services, a JavaScript engine that allows access to information in a Java program, JDBC 4.0, JAXB 2.0, XML digital signature APIs, more sophisticated Swing components, and improvements in Java 2D that includes a GIF image writer.

Table of Contents

  1. Copyright
  2. Introduction
    1. Java Naming Convention
    2. Those New to Java 5
    3. About This Book
    4. Downloading and Installing Java 6
    5. Code Download
  3. 1. Core Libraries
    1. Empty String Checking
    2. File Class Enhancements
    3. Array Reallocation
    4. The Collections Framework New Types
      1. The Deque Interface
      2. The NavigableSet Interface
      3. The NavigableMap Interface
    5. Floating Point Enhancements
    6. Password Prompting with java.io.Console
    7. Summary
  4. 2. Dynamic Compilation
    1. The Compiler Framework
      1. The JavaCompilerTool Interface
      2. The JavaCompilerTool.CompilationTask Class
      3. The JavaFileObject Interface
      4. The ToolProvider Class
      5. The Dagnostic Interface
    2. Using JavaCompilerTool
    3. Using Diagnostics
    4. Summary
  5. 3. Scripting
    1. Core Types
      1. The ScriptEngineManager Class
      2. The ScriptEngineFactory Interface
      3. The Bindings Interface
      4. The ScriptEngine Interface
    2. Listing All Script Engines
    3. Running Scripts
    4. Binding Scripts
    5. Using Invocable
    6. Using Compilable
    7. Summary
  6. 4. Networking
    1. Client-Side Cookies
      1. HttpCookie
      2. CookieStore
      3. CookiePolicy
      4. CookieManager
    2. HttpCookie Example
    3. Internationalized Domain Names (IDNs)
    4. Internationalized Resource Identifiers
    5. The InterfaceAddress Interface
    6. Lightweight HTTP Server
      1. The HttpServer Class
      2. The HttpContext Class
      3. The HttpHandler Interface
      4. The HttpExchange Class
      5. An Example of HttpServer
    7. Summary
  7. 5. Swing Updates
    1. Better Windows Look and Feel
    2. Better GTK Look and Feel
    3. Improvement to Drag and Drop
      1. DnD Basic
      2. DataFlavor, Transferable, and TransferHandler
      3. DnD Improvement in Mustang
    4. True Double Buffering
    5. JTable Sorting
    6. JTable Filtering
    7. Swing Worker
    8. Text Component Printing
    9. New Methods in the JTabPane Component
    10. Summary
  8. 6. Abstract Window Toolkit
    1. Improved Dialog Modality
      1. Using APPLICATION_MODAL
      2. Using DOCUMENT_MODAL
      3. Modality Exclusion
    2. Fast Splash Screens
    3. System Tray Support
    4. Desktop Help Applications
    5. GIF Writer
    6. Text Antialiasing
    7. Summary
  9. 7. Internationalization
    1. New Supported Locales
    2. Locale Sensitive Services SPI
    3. Resource Bundle Enhancement
    4. ResourceBundle.Control
    5. Summary
  10. 8. Java Database Connectivity 4.0
    1. Driver Loading
    2. Ease of Development Features
      1. The Query Interface
      2. JDBC Annotations
        1. Select
        2. Update
        3. AutoGeneratedKeys
        4. ResultColumn
      3. The DataSet Interface
      4. Query Interface Example
    3. Support for National Character Sets
    4. Iterable SQLException
    5. RowId Type
    6. SQLXML Interface
    7. Summary
  11. 9. XML Digital Signature API
    1. Java Cryptography
      1. Key Generation
        1. The KeyPairGenerator Class
        2. The KeyPair Class
        3. The PrivateKey and PublicKey Interfaces
    2. XML Signature Overview
    3. JSR 105 API Overview
    4. Signature Validation
    5. Summary
  12. 10. Streaming API for XML
    1. Reading XML
      1. Using XMLStreamReader
      2. Using XMLEventReader
    2. Writing to XML
      1. Using XMLStreamWriter
      2. Using XMLEventWriter
    3. Summary
  13. 11. Java Architecture for XML Binding
    1. Introduction to JAXB
    2. Marshalling Java Objects
    3. Unmarshalling
      1. XML Binding Compiler
      2. The Unmarshaller Interface
    4. Summary
  14. 12. Web Services
    1. Web Service Annotations
      1. WebService
      2. WebMethod
      3. WebParam
      4. WebResult
    2. A Web Service Example
    3. Summary
  15. 13. JavaBeans Activation Framework
    1. Introduction to JAF
      1. The DataSource Interface
      2. The CommandMap Class
      3. The CommandInfo Class
      4. The CommandObject Interface
      5. The DataHandler Class
    2. A JAF Example
    3. Summary
  16. 14. User-Defined MXBeans
    1. Java Management Extensions (JMX)
    2. The JMX API
      1. MBeanServer
      2. ObjectName
    3. Standard MBeans
    4. MXBeans
    5. Using @MXBean
    6. Using @DescriptorKey
    7. Summary
  17. 15. Concurrency Updates
    1. BlockingDeque
    2. TimeUnit enum
    3. ConcurrentHashMap
    4. Summary
  18. A. Enums
    1. Introduction to enum
    2. Enums in a Class
    3. The java.lang.Enum Class
    4. Iterating over Enumerated Values
    5. Switching on Enum
  19. B. Generics
    1. Life without Generics
    2. Introducing Generic Types
    3. Using Generic Types without Type Parameters
    4. Using the ? Wildcard
    5. Using Bounded Wildcards in Methods
    6. Writing Generic Types
  20. C. Annotations
    1. An Overview of Annotations
      1. Annotations and Annotation Types
      2. Annotation Syntax
      3. The Annotation Interface
    2. Standard Annotations
      1. Override
      2. Deprecated
      3. SuppressWarnings
    3. Standard Meta-Annotations
      1. Documented
      2. Inherited
      3. Retention
      4. Target
    4. Custom Annotation Types
      1. A Custom Annotation Type
      2. Using Custom Annotation Type
      3. Using Reflection to Query Annotations