2
* Copyright 2001-2004 The Apache Software Foundation.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
17
package org.apache.axis.schema;
19
import org.apache.axis.Constants;
20
import org.apache.axis.encoding.TypeMappingImpl;
21
import org.apache.axis.encoding.ser.CalendarDeserializerFactory;
22
import org.apache.axis.encoding.ser.CalendarSerializerFactory;
24
import javax.xml.namespace.QName;
27
* 2001 Schema characteristics.
29
* @author Glen Daniels (gdaniels@apache.org)
31
public class SchemaVersion2001 implements SchemaVersion {
32
public static QName QNAME_NIL = new QName(Constants.URI_2001_SCHEMA_XSI,
36
* Package-access constructor - access this through SchemaVersion
43
* Get the appropriate QName for the "null"/"nil" attribute for this
45
* @return {http://www.w3.org/2001/XMLSchema-instance}nil
47
public QName getNilQName() {
55
public String getXsiURI() {
56
return Constants.URI_2001_SCHEMA_XSI;
63
public String getXsdURI() {
64
return Constants.URI_2001_SCHEMA_XSD;
68
* Register the schema specific type mappings
70
public void registerSchemaSpecificTypes(TypeMappingImpl tm) {
72
// This mapping will convert a Java 'Date' type to a dateTime
73
tm.register(java.util.Date.class,
74
Constants.XSD_DATETIME,
75
new CalendarSerializerFactory(java.util.Date.class,
76
Constants.XSD_DATETIME),
77
new CalendarDeserializerFactory(java.util.Date.class,
78
Constants.XSD_DATETIME)
81
// This is the preferred mapping per JAX-RPC.
82
// Last one registered take priority
83
tm.register(java.util.Calendar.class,
84
Constants.XSD_DATETIME,
85
new CalendarSerializerFactory(java.util.Calendar.class,
86
Constants.XSD_DATETIME),
87
new CalendarDeserializerFactory(java.util.Calendar.class,
88
Constants.XSD_DATETIME)