|
1 /* |
|
2 * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. |
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 * |
|
5 * This code is free software; you can redistribute it and/or modify it |
|
6 * under the terms of the GNU General Public License version 2 only, as |
|
7 * published by the Free Software Foundation. Oracle designates this |
|
8 * particular file as subject to the "Classpath" exception as provided |
|
9 * by Oracle in the LICENSE file that accompanied this code. |
|
10 * |
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 * version 2 for more details (a copy is included in the LICENSE file that |
|
15 * accompanied this code). |
|
16 * |
|
17 * You should have received a copy of the GNU General Public License version |
|
18 * 2 along with this work; if not, write to the Free Software Foundation, |
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 * |
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 * or visit www.oracle.com if you need additional information or have any |
|
23 * questions. |
|
24 */ |
|
25 |
|
26 /** |
|
27 * |
|
28 * <p> |
|
29 * Defines XML/Java Type Mappings. |
|
30 * |
|
31 * <p> |
|
32 * This API provides XML/Java type mappings. |
|
33 * |
|
34 * <p> |
|
35 * The following XML standards apply: |
|
36 * |
|
37 * <ul> |
|
38 * <li><a href="http://www.w3.org/TR/xmlschema-2/#dateTime"> |
|
39 * W3C XML Schema 1.0 Part 2, Section 3.2.7-14</a> |
|
40 * </li> |
|
41 * <li><a href="http://www.w3.org/TR/xpath-datamodel#dt-dayTimeDuration"> |
|
42 * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a> |
|
43 * </li> |
|
44 * <li><a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthDuration"> |
|
45 * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a> |
|
46 * </li> |
|
47 * </ul> |
|
48 * |
|
49 * <hr> |
|
50 * |
|
51 * <table class="striped"> |
|
52 * <caption> W3C XML Schema/Java Type Mappings</caption> |
|
53 * <thead> |
|
54 * <tr> |
|
55 * <th>W3C XML Schema Data Type</th> |
|
56 * <th>Java Data Type</th> |
|
57 * </tr> |
|
58 * </thead> |
|
59 * |
|
60 * <tbody> |
|
61 * <tr> |
|
62 * <td>xs:date</td> |
|
63 * <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td> |
|
64 * </tr> |
|
65 * <tr> |
|
66 * <td>xs:dateTime</td> |
|
67 * <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td> |
|
68 * </tr> |
|
69 * <tr> |
|
70 * <td>xs:duration</td> |
|
71 * <td>{@link javax.xml.datatype.Duration}</td> |
|
72 * </tr> |
|
73 * <tr> |
|
74 * <td>xs:gDay</td> |
|
75 * <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td> |
|
76 * </tr> |
|
77 * <tr> |
|
78 * <td>xs:gMonth </td> |
|
79 * <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td> |
|
80 * </tr> |
|
81 * <tr> |
|
82 * <td>xs:gMonthDay</td> |
|
83 * <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td> |
|
84 * </tr> |
|
85 * <tr> |
|
86 * <td>xs:gYear</td> |
|
87 * <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td> |
|
88 * </tr> |
|
89 * <tr> |
|
90 * <td>xs:gYearMonth</td> |
|
91 * <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td> |
|
92 * </tr> |
|
93 * <tr> |
|
94 * <td>xs:time</td> |
|
95 * <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td> |
|
96 * </tr> |
|
97 * |
|
98 * </tbody> |
|
99 * </table> |
|
100 * |
|
101 * <hr> |
|
102 * |
|
103 * |
|
104 * <table class="striped"> |
|
105 * <caption>XQuery and XPath/Java Type Mappings</caption> |
|
106 * <thead> |
|
107 * <tr> |
|
108 * <th>XQuery 1.0 and XPath 2.0 Data Model</th> |
|
109 * <th>Java Data Type</th> |
|
110 * </tr> |
|
111 * </thead> |
|
112 * |
|
113 * <tbody> |
|
114 * <tr> |
|
115 * <td>xdt:dayTimeDuration</td> |
|
116 * <td>{@link javax.xml.datatype.Duration}</td> |
|
117 * </tr> |
|
118 * <tr> |
|
119 * <td>xdt:yearMonthDuration</td> |
|
120 * <td>{@link javax.xml.datatype.Duration}</td> |
|
121 * </tr> |
|
122 * </tbody> |
|
123 * </table> |
|
124 * |
|
125 * <hr> |
|
126 * |
|
127 * <p> |
|
128 * W3C XML Schema data types that have a "<em>natural</em>" mapping to Java types are defined by |
|
129 * JSR 31: Java™ Architecture for XML Binding (JAXB) Specification, Binding XML Schema to Java Representations. |
|
130 * JAXB defined mappings for XML Schema built-in data types include: |
|
131 * |
|
132 * <ul> |
|
133 * <li>xs:anySimpleType</li> |
|
134 * <li>xs:base64Binary</li> |
|
135 * <li>xs:boolean</li> |
|
136 * <li>xs:byte</li> |
|
137 * <li>xs:decimal</li> |
|
138 * <li>xs:double</li> |
|
139 * <li>xs:float</li> |
|
140 * <li>xs:hexBinary</li> |
|
141 * <li>xs:int</li> |
|
142 * <li>xs:integer</li> |
|
143 * <li>xs:long</li> |
|
144 * <li>xs:QName</li> |
|
145 * <li>xs:short</li> |
|
146 * <li>xs:string</li> |
|
147 * <li>xs:unsignedByte</li> |
|
148 * <li>xs:unsignedInt</li> |
|
149 * <li>xs:unsignedShort</li> |
|
150 * </ul> |
|
151 * |
|
152 * <hr> |
|
153 * |
|
154 * <ul> |
|
155 * <li>Author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a></li> |
|
156 * <li>See <a href="http://www.w3.org/TR/xmlschema-2/#dateTime"> |
|
157 * W3C XML Schema 1.0 Part 2, Section 3.2.7-14</a> |
|
158 * </li> |
|
159 * <li>See <a href="http://www.w3.org/TR/xpath-datamodel#dt-dayTimeDuration"> |
|
160 * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a> |
|
161 * </li> |
|
162 * <li>See <a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthDuration"> |
|
163 * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a> |
|
164 * </li> |
|
165 * <li>Since 1.5</li> |
|
166 * </ul> |
|
167 * |
|
168 * <hr> |
|
169 * @since 1.5 |
|
170 */ |
|
171 |
|
172 package javax.xml.datatype; |