KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > encoding > TypeMapping


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
18 package org.apache.axis.encoding;
19
20 import java.io.Serializable JavaDoc;
21 import javax.xml.namespace.QName JavaDoc;
22 import javax.xml.rpc.JAXRPCException JavaDoc;
23 import javax.xml.rpc.encoding.DeserializerFactory JavaDoc;
24 import javax.xml.rpc.encoding.SerializerFactory JavaDoc;
25
26
27
28 /**
29  * This interface describes the AXIS TypeMapping.
30  */

31 public interface TypeMapping
32     extends javax.xml.rpc.encoding.TypeMapping JavaDoc, Serializable JavaDoc {
33
34     /**
35      * Gets the SerializerFactory registered for the specified pair
36      * of Java type and XML data type.
37      *
38      * @param javaType - Class of the Java type
39      *
40      * @return Registered SerializerFactory
41      *
42      * @throws JAXRPCException - If there is no registered SerializerFactory
43      * for this pair of Java type and XML data type
44      * java.lang.IllegalArgumentException
45      * If invalid or unsupported XML/Java type is specified
46      */

47     public SerializerFactory getSerializer(Class JavaDoc javaType)
48         throws JAXRPCException JavaDoc;
49
50     /**
51      * Gets the DeserializerFactory registered for the specified XML data type.
52      *
53      * @param xmlType - Qualified name of the XML data type
54      *
55      * @return Registered DeserializerFactory
56      *
57      * @throws JAXRPCException - If there is no registered DeserializerFactory
58      * for this pair of Java type and XML data type
59      * java.lang.IllegalArgumentException -
60      * If invalid or unsupported XML/Java type is specified
61      */

62     public DeserializerFactory getDeserializer(QName JavaDoc xmlType)
63         throws JAXRPCException JavaDoc;
64
65     /**
66      * Gets the QName for the type mapped to Class.
67      * @param javaType class or type
68      * @return xmlType qname or null
69      */

70     public QName JavaDoc getTypeQName(Class JavaDoc javaType);
71     
72     /**
73      * Get the QName for this Java class, but only return a specific
74      * mapping if there is one. In other words, don't do special array
75      * processing, etc.
76      *
77      * @param javaType
78      * @return
79      */

80     public QName JavaDoc getTypeQNameExact(Class JavaDoc javaType);
81
82     /**
83      * Gets the Class mapped to QName.
84      * @param xmlType qname or null
85      * @return javaType class for type or null for no mapping
86      */

87     public Class JavaDoc getClassForQName(QName JavaDoc xmlType);
88
89     public Class JavaDoc getClassForQName(QName JavaDoc xmlType, Class JavaDoc javaType);
90
91     /**
92      * Returns an array of all the classes contained within this mapping
93      */

94     public Class JavaDoc [] getAllClasses();
95
96     /**
97      * Get the exact XML type QName which will be used when serializing a
98      * given Class to a given type QName. In other words, if we have:
99      *
100      * Class TypeQName
101      * ----------------------
102      * Base myNS:Base
103      * Child myNS:Child
104      *
105      * and call getXMLType(Child.class, BASE_QNAME), we should get
106      * CHILD_QNAME.
107      *
108      * @param javaType
109      * @param xmlType
110      * @return the type's QName
111      * @throws javax.xml.rpc.JAXRPCException
112      */

113     QName JavaDoc getXMLType(Class JavaDoc javaType, QName JavaDoc xmlType, boolean encoded)
114         throws JAXRPCException JavaDoc;
115 }
116
117
118
Popular Tags