KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > rpc > 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 package javax.xml.rpc.encoding;
17
18 import javax.xml.namespace.QName JavaDoc;
19
20 /**
21  * The <code>javax.xml.rpc.encoding.TypeMapping</code> is the base
22  * interface for the representation of a type mapping. A TypeMapping
23  * implementation class may support one or more encoding styles.
24  * <p>
25  * For its supported encoding styles, a TypeMapping instance
26  * maintains a set of tuples of the type {Java type,
27  * <code>SerializerFactory</code>,
28  * <code>DeserializerFactory</code>, XML type}.
29  *
30  * @version 1.0
31  */

32 public interface TypeMapping {
33
34     /**
35      * Returns the encodingStyle URIs (as String[]) supported by
36      * this TypeMapping instance. A TypeMapping that contains only
37      * encoding style independent serializers and deserializers
38      * returns <code>null</code> from this method.
39      *
40      * @return Array of encodingStyle URIs for the supported
41      * encoding styles
42      */

43     public String JavaDoc[] getSupportedEncodings();
44
45     /**
46      * Sets the encodingStyle URIs supported by this TypeMapping
47      * instance. A TypeMapping that contains only encoding
48      * independent serializers and deserializers requires
49      * <code>null</code> as the parameter for this method.
50      *
51      * @param encodingStyleURIs Array of encodingStyle URIs for the
52      * supported encoding styles
53      */

54     public void setSupportedEncodings(String JavaDoc[] encodingStyleURIs);
55
56     /**
57      * Checks whether or not type mapping between specified XML
58      * type and Java type is registered.
59      *
60      * @param javaType Class of the Java type
61      * @param xmlType Qualified name of the XML data type
62      * @return boolean; <code>true</code> if type mapping between the
63      * specified XML type and Java type is registered;
64      * otherwise <code>false</code>
65      */

66     public boolean isRegistered(Class JavaDoc javaType, QName JavaDoc xmlType);
67
68     /**
69      * Registers SerializerFactory and DeserializerFactory for a
70      * specific type mapping between an XML type and Java type.
71      * This method replaces any existing registered SerializerFactory
72      * DeserializerFactory instances.
73      *
74      * @param javaType Class of the Java type
75      * @param xmlType Qualified name of the XML data type
76      * @param sf SerializerFactory
77      * @param dsf DeserializerFactory
78      *
79      * @throws javax.xml.rpc.JAXRPCException if there are any errors that
80      * prevent registration
81      */

82     public void register(Class JavaDoc javaType, QName JavaDoc xmlType, SerializerFactory JavaDoc sf,
83                          DeserializerFactory JavaDoc dsf);
84
85     /**
86      * Gets the SerializerFactory registered for the specified
87      * pair of Java type and XML data type.
88      *
89      * @param javaType Class of the Java type
90      * @param xmlType Qualified name of the XML data type
91      *
92      * @return Registered SerializerFactory or <code>null</code>
93      * if there is no registered factory
94      */

95     public SerializerFactory JavaDoc getSerializer(Class JavaDoc javaType, QName JavaDoc xmlType);
96
97     /**
98      * Gets the DeserializerFactory registered for the specified pair
99      * of Java type and XML data type.
100      *
101      * @param javaType Class of the Java type
102      * @param xmlType Qualified name of the XML data type
103      *
104      * @return Registered SerializerFactory or <code>null</code>
105      * if there is no registered factory
106      */

107     public DeserializerFactory JavaDoc getDeserializer(Class JavaDoc javaType, QName JavaDoc xmlType);
108
109     /**
110      * Removes the SerializerFactory registered for the specified
111      * pair of Java type and XML data type.
112      *
113      * @param javaType Class of the Java type
114      * @param xmlType Qualified name of the XML data type
115      *
116      * @throws javax.xml.rpc.JAXRPCException if there is any error that prevents
117      * removal of the registered SerializerFactory
118      */

119     public void removeSerializer(Class JavaDoc javaType, QName JavaDoc xmlType);
120
121     /**
122      * Removes the DeserializerFactory registered for the specified
123      * pair of Java type and XML data type.
124      *
125      * @param javaType Class of the Java type
126      * @param xmlType Qualified name of the XML data type
127      *
128      * @throws javax.xml.rpc.JAXRPCException if there is any error in removing
129      * the registered DeserializerFactory
130      */

131     public void removeDeserializer(Class JavaDoc javaType, QName JavaDoc xmlType);
132 }
133
134
Popular Tags