Java and XML Data Binding

Free Download

Authors:

Edition: 1

ISBN: 9780596002787, 0596002785

Size: 2 MB (2400773 bytes)

Pages: 200/200

File format:

Language:

Publishing Year:

Category: Tags: , ,

Brett McLaughlin9780596002787, 0596002785

This new title provides an in-depth technical look at XML Data Binding. The book offers complete documentation of all features in both the Sun Microsystems JAXB API and popular open source alternative implementations (Enhydra Zeus, Exolabs Castor and Quick). It also gets into significant detail about when data binding is appropriate to use, and provides numerous practical examples of using data binding in applications.

Table of contents :
Table of Content……Page 3
Organization……Page 6
Comments and Questions……Page 8
Acknowledgments……Page 9
1.1 Low-Level APIs……Page 10
1.1.2 Modeled Data……Page 12
1.2 High-Level APIs……Page 13
1.2.2 Messaged Data……Page 15
1.3.1 Class Generation……Page 16
1.3.3 Marshalling……Page 17
1.4.1 Packages……Page 18
1.4.2 Tools……Page 19
2.1.1 SAX……Page 21
Example 2-1. The EnhydraErrorHandler class……Page 22
Example 2-2. Using an EntityResolver for Sun EJB DTDs……Page 24
2.1.2 DOM……Page 25
2.2.1 SOAP……Page 26
2.2.2 UDDI……Page 27
2.3.1 DTDs……Page 28
2.3.2 XML Schema……Page 30
2.3.3 And More ………Page 31
2.4.1 Independence……Page 33
2.4.1.2 Version independence……Page 34
2.4.3 Interoperation……Page 35
3.1.1 Constraints……Page 37
3.1.2 Binding Schema……Page 38
3.1.3 Generation……Page 39
3.2 Creating the Constraints……Page 40
Example 3-1. Movie database DTD……Page 41
3.2.2 Deterministic Modeling……Page 42
3.2.3 Simple Elements……Page 43
3.2.4 Constraint Naming……Page 45
3.3.1 The Minimum Binding Schema……Page 46
Table?3-1. Global binding schema options……Page 47
Example 3-4. Modified binding schema for movies database……Page 48
Example 3-5. Batch file for class generation using JAXB……Page 50
3.4.2 Supplying Output……Page 51
Figure 3-2. Filesystem layout……Page 52
3.4.3 Verifying Output……Page 53
4.1.1 XML Data……Page 55
4.1.2 Java Conversion……Page 56
Figure 4-1. Object instance tree for movie database……Page 57
Figure 4-2. Unmarshalling process flow……Page 58
Figure 4-3. Editing XML with XML Spy……Page 59
Example 4-1. Sample movie database……Page 61
Example 4-2. Simple validation program……Page 62
4.3.1 XML Input……Page 64
4.3.2 Java Output……Page 65
4.3.3 Intermediate Objects……Page 67
4.4.1 Business Objects……Page 68
Example 4-3. The MoviesServlet class……Page 69
Figure 4-5. The MoviesServlet viewing the database……Page 71
4.4.2 Data Objects……Page 72
Example 4-5. The connection binding schema……Page 73
Example 4-7. The MovieClient class……Page 74
5.1.1 Java Objects……Page 79
5.1.2 XML Conversion……Page 80
5.2 Validating Java Objects……Page 81
Example 5-1. Errors from missing attributes……Page 82
Figure 5-2. Validation exceptions in JAXB……Page 84
Example 5-2. Illegal XML not caught by JAXB……Page 85
5.2.2 Non-JAXB Objects……Page 87
5.3.1.1 The server……Page 88
Table?5-1. Allowed parameters for the MoviesServlet……Page 89
5.3.1.2 The client……Page 92
Example 5-3. The Arguments utility class……Page 93
Example 5-4. The modified MovieClient class……Page 94
Example 5-5. Modified XML database……Page 97
Figure 5-4. Process loops in the movie database……Page 98
5.4.2 Equivalence……Page 99
6.1.1 XML to Java……Page 101
6.1.2 Intermediary Transformations……Page 102
6.2.1 Packaging……Page 103
6.2.4 Marshalling and Unmarshalling……Page 104
6.3.1 Elements……Page 105
6.3.2 Content Specification……Page 107
6.3.2.1 Element references……Page 108
6.3.2.2 Choices……Page 110
6.3.2.3 Sequences……Page 111
6.3.2.4 Rests……Page 112
6.3.3 Attributes……Page 113
6.4.1 Enumerations……Page 114
6.4.2 Conversions……Page 117
Example 6-1. The DateConversion class……Page 119
6.4.3 Constructors……Page 120
Example 6-2. The Person interface……Page 121
7.1.1 Class Generation……Page 124
Figure 7-1. The Zeus process flow for class generation……Page 125
7.2 Installation and Setup……Page 126
7.3.1 DTDs……Page 127
Example 7-1. A partial DTD for web.xml descriptors……Page 128
7.4.1 Unmarshalling……Page 131
Example 7-2. A sample descriptor……Page 132
Example 7-3. The WebAppUnmarshaller class……Page 134
Example 7-4. A simple unmarshalling example with Zeus……Page 135
7.4.2 Marshalling……Page 136
7.5.1 Self-Containment……Page 139
7.5.2 Ant Taskdef……Page 141
Figure 8-1. Class generation in Castor……Page 143
8.2 Installation and Setup……Page 144
8.3.1 DTDs……Page 145
Example 8-1. HR database constraint model……Page 146
Table?8-1. Castor SourceGenerator options……Page 148
Example 8-2. HR instance document……Page 149
Example 8-3. Unmarshalling with Castor……Page 150
8.4.2 Marshalling……Page 152
Example 8-4. A Castor mapping file for the HR classes……Page 155
Example 8-5. EmployeeLister with mapping code……Page 157
Example 8-6. Converted HR XML document……Page 160
8.5 Additional Features……Page 161
8.5.2 JDO……Page 162
Example 9-1. A confusing purchase order……Page 166
Figure 9-1. Classes for an XML document……Page 167
Example 9-2. A more readable purchase order……Page 168
9.1.2 Performance Considerations……Page 169
9.3 Unmarshalling and Marshalling……Page 170
Example 9-3. DTD for Example 9-1……Page 171
Example 9-4. QDML for Example 9-1……Page 172
9.3.1.3 Converting QDML to QJML……Page 173
Example 9-5. QJML for use in unmarshalling……Page 174
9.3.1.4 More conversion……Page 175
Example 9-6. Unmarshalling using Quick……Page 176
Figure 9-3. Quick unmarshalling……Page 178
9.3.2 Marshalling……Page 179
Example 9-8. Converting XML formats using QJML……Page 181
9.4.1 Class Generation……Page 183
9.4.2 QDML to DTD……Page 184
10.1.1 Final Release……Page 185
10.2.1 JAXB Conformance……Page 186
10.2.2 Overlaying Functionality……Page 187
10.3.1 Data Binding in Enterprise Applications……Page 188
Table?10-1. The current JAX-pack……Page 189
Table?A-2. Zeus DTDSourceGenerator options……Page 191
Table?A-3. Castor SourceGenerator options……Page 192
Table?A-5. Quick cfgQdml2Qjml options……Page 193
Table?A-6. Quick cfgQjml2Java options……Page 194
Table?A-7. Quick cfgQdml2Dtd options……Page 195
Example B-1. The PurchaseOrder class……Page 196
Example B-2. The order class……Page 197
Example B-3. The stock class……Page 198
Colophon……Page 199

Reviews

There are no reviews yet.

Be the first to review “Java and XML Data Binding”
Shopping Cart
Scroll to Top