KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > schema > SchemaVersion2000


1 /*
2  * Copyright 2001-2004 The Apache Software Foundation.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */

16
17 package org.apache.axis.schema;
18
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;
23
24 import javax.xml.namespace.QName JavaDoc;
25
26 /**
27  * 2000 Schema characteristics.
28  *
29  * @author Glen Daniels (gdaniels@apache.org)
30  */

31 public class SchemaVersion2000 implements SchemaVersion {
32     public static QName JavaDoc QNAME_NIL = new QName JavaDoc(Constants.URI_2000_SCHEMA_XSI,
33                                               "null");
34     /**
35      * Package-access constructor - access this through SchemaVersion
36      * constants.
37      */

38     SchemaVersion2000() {
39     }
40
41     /**
42      * Get the appropriate QName for the "null"/"nil" attribute for this
43      * Schema version.
44      * @return {http://www.w3.org/2000/10/XMLSchema-instance}null
45      */

46     public QName JavaDoc getNilQName() {
47         return QNAME_NIL;
48     }
49
50     /**
51      * The XSI URI
52      * @return the XSI URI
53      */

54     public String JavaDoc getXsiURI() {
55         return Constants.URI_2000_SCHEMA_XSI;
56     }
57
58     /**
59      * The XSD URI
60      * @return the XSD URI
61      */

62     public String JavaDoc getXsdURI() {
63         return Constants.URI_2000_SCHEMA_XSD;
64     }
65     /**
66      * Register the schema specific type mappings
67      */

68     public void registerSchemaSpecificTypes(TypeMappingImpl tm) {
69         
70         // Register the timeInstant type
71
tm.register(java.util.Calendar JavaDoc.class,
72                     Constants.XSD_TIMEINSTANT2000,
73                     new CalendarSerializerFactory(java.util.Calendar JavaDoc.class,
74                                                   Constants.XSD_TIMEINSTANT2000),
75                     new CalendarDeserializerFactory(java.util.Calendar JavaDoc.class,
76                                                     Constants.XSD_TIMEINSTANT2000));
77     }
78 }
79
Popular Tags