1 <?xml version="1.0" encoding="UTF-8"?> 2 <!-- $Id: package.html 541939 2007-05-26 21:10:52Z mrglavas $ --> 3 4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 5 <html xmlns="http://www.w3.org/1999/xhtml"> 6 7 <head> 8 <title>javax.xml.datatype</title> 9 10 <meta name="@author" content="mailto:Jeff.Suttor (a] Sun.com" /> 11 <meta name="@version" content="$Revision: 541939 $, $Date: 2007-05-26 14:10:52 -0700 (Sat, 26 May 2007) $" /> 12 <meta name="@see" content='http://www.w3.org/TR/xmlschema-2/#dateTime">W3C XML Schema 1.0 Part 2, Section 3.2.7-14' /> 13 <meta name="@see" content='http://www.w3.org/TR/xpath-datamodel/#dayTimeDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration' /> 14 <meta name="@see" content='http://www.w3.org/TR/xpath-datamodel/#yearMonthDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration' /> 15 <meta name="@since" content="1.5" /> 16 </head> 17 18 <body> 19 20 <p>XML/Java Type Mappings.</p> 21 22 <p>The <code>javax.xml.datatype</code> API provides XML/Java type mappings.</p> 23 24 <p>The following XML standards apply:</p> 25 <ul> 26 <li><a href="http://www.w3.org/TR/xmlschema-2/#dateTime">W3C XML Schema 1.0 Part 2, Section 3.2.7-14</a></li> 27 <li><a href="http://www.w3.org/TR/xpath-datamodel/#dayTimeDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a></li> 28 <li><a href="http://www.w3.org/TR/xpath-datamodel/#yearMonthDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a></li> 29 </ul> 30 31 <hr /> 32 33 <table border="1" cellpadding="2"> 34 <thead> 35 <tr> 36 <th>W3C XML Schema Data Type</th> 37 <th>Java Data Type</th> 38 </tr> 39 </thead> 40 41 <tbody> 42 <tr> 43 <td>xs:date</td> 44 <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td> 45 </tr> 46 <tr> 47 <td>xs:dateTime</td> 48 <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td> 49 </tr> 50 <tr> 51 <td>xs:duration</td> 52 <td>{@link javax.xml.datatype.Duration}</td> 53 </tr> 54 <tr> 55 <td>xs:gDay</td> 56 <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td> 57 </tr> 58 <tr> 59 <td>xs:gMonth </td> 60 <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td> 61 </tr> 62 <tr> 63 <td>xs:gMonthDay</td> 64 <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td> 65 </tr> 66 <tr> 67 <td>xs:gYear</td> 68 <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td> 69 </tr> 70 <tr> 71 <td>xs:gYearMonth</td> 72 <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td> 73 </tr> 74 <tr> 75 <td>xs:time</td> 76 <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td> 77 </tr> 78 79 </tbody> 80 </table> 81 82 <hr /> 83 84 85 <table border="1" cellpadding="2"> 86 <thead> 87 <tr> 88 <th>XQuery 1.0 and XPath 2.0 Data Model</th> 89 <th>Java Data Type</th> 90 </tr> 91 </thead> 92 93 <tbody> 94 <tr> 95 <td>xdt:dayTimeDuration</td> 96 <td>{@link javax.xml.datatype.Duration}</td> 97 </tr> 98 <tr> 99 <td>xdt:yearMonthDuration</td> 100 <td>{@link javax.xml.datatype.Duration}</td> 101 </tr> 102 </tbody> 103 </table> 104 105 <hr /> 106 107 <p> 108 W3C XML Schema data types that have a "<em>natural</em>" mapping to Java types are defined by 109 JSR 31: Java™ Architecture for XML Binding (JAXB) Specification, Binding XML Schema to Java Representations. 110 JAXB defined mappings for XML Schema built-in data types include: 111 </p> 112 <ul> 113 <li>xs:anySimpleType</li> 114 <li>xs:base64Binary</li> 115 <li>xs:boolean</li> 116 <li>xs:byte</li> 117 <li>xs:decimal</li> 118 <li>xs:double</li> 119 <li>xs:float</li> 120 <li>xs:hexBinary</li> 121 <li>xs:int</li> 122 <li>xs:integer</li> 123 <li>xs:long</li> 124 <li>xs:QName</li> 125 <li>xs:short</li> 126 <li>xs:string</li> 127 <li>xs:unsignedByte</li> 128 <li>xs:unsignedInt</li> 129 <li>xs:unsignedShort</li> 130 </ul> 131 132 <hr /> 133 134 135 <ul> 136 <li>Author <a href="mailto:Jeff.Suttor (a] Sun.com">Jeff Suttor</a></li> 137 <li>See <a href="http://www.w3.org/TR/xmlschema-2/#dateTime">W3C XML Schema 1.0 Part 2, Section 3.2.7-14</a></li> 138 <li>See <a href="http://www.w3.org/TR/xpath-datamodel/#dayTimeDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a></li> 139 <li>See <a href="http://www.w3.org/TR/xpath-datamodel/#yearMonthDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a></li> 140 <li>Since 1.5</li> 141 </ul> 142 143 <hr /> 144 145 146 </body> 147 </html> 148