KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > wsif > util > TypeSerializerInfo


1 /*
2  * The Apache Software License, Version 1.1
3  *
4  *
5  * Copyright (c) 2002 The Apache Software Foundation. All rights
6  * reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in
17  * the documentation and/or other materials provided with the
18  * distribution.
19  *
20  * 3. The end-user documentation included with the redistribution,
21  * if any, must include the following acknowledgment:
22  * "This product includes software developed by the
23  * Apache Software Foundation (http://www.apache.org/)."
24  * Alternately, this acknowledgment may appear in the software itself,
25  * if and wherever such third-party acknowledgments normally appear.
26  *
27  * 4. The names "WSIF" and "Apache Software Foundation" must
28  * not be used to endorse or promote products derived from this
29  * software without prior written permission. For written
30  * permission, please contact apache@apache.org.
31  *
32  * 5. Products derived from this software may not be called "Apache",
33  * nor may "Apache" appear in their name, without prior written
34  * permission of the Apache Software Foundation.
35  *
36  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39  * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
40  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
43  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
44  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
46  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47  * SUCH DAMAGE.
48  * ====================================================================
49  *
50  * This software consists of voluntary contributions made by many
51  * individuals on behalf of the Apache Software Foundation and was
52  * originally based on software copyright (c) 2001, 2002, International
53  * Business Machines, Inc., http://www.apache.org. For more
54  * information on the Apache Software Foundation, please see
55  * <http://www.apache.org/>.
56  */

57
58 package org.apache.wsif.util;
59
60 import java.io.Serializable JavaDoc;
61
62 import javax.xml.namespace.QName JavaDoc;
63
64 import org.apache.wsif.logging.Trc;
65
66 /**
67  * This class maps a element/java type with its (de)serializers
68  */

69 public class TypeSerializerInfo implements Serializable JavaDoc {
70
71     private static final long serialVersionUID = 1L;
72
73     protected QName JavaDoc elementType;
74     protected Class JavaDoc javaType;
75     protected Object JavaDoc serializer;
76     protected Object JavaDoc deserializer;
77
78     public TypeSerializerInfo(
79         QName JavaDoc elementType,
80         Class JavaDoc javaType,
81         Object JavaDoc serializer,
82         Object JavaDoc deserializer) {
83         Trc.entry(this, elementType, javaType, serializer, deserializer);
84         this.elementType = elementType;
85         this.javaType = javaType;
86         this.serializer = serializer;
87         this.deserializer = deserializer;
88         Trc.exit();
89     }
90
91     /**
92      * Returns the deserializer.
93      * @return Object
94      */

95     public Object JavaDoc getDeserializer() {
96         Trc.entry(this);
97         Trc.exit(deserializer);
98         return deserializer;
99     }
100
101     /**
102      * Returns the elementType.
103      * @return QName
104      */

105     public QName JavaDoc getElementType() {
106         Trc.entry(this);
107         Trc.exit(elementType);
108         return elementType;
109     }
110
111     /**
112      * Returns the javaType.
113      * @return Class
114      */

115     public Class JavaDoc getJavaType() {
116         Trc.entry(this);
117         Trc.exit(javaType);
118         return javaType;
119     }
120
121     /**
122      * Returns the serializer.
123      * @return Object
124      */

125     public Object JavaDoc getSerializer() {
126         Trc.entry(this);
127         Trc.exit(serializer);
128         return serializer;
129     }
130
131     /**
132      * Sets the deserializer.
133      * @param deserializer The deserializer to set
134      */

135     public void setDeserializer(Object JavaDoc deserializer) {
136         Trc.entry(this, deserializer);
137         this.deserializer = deserializer;
138         Trc.exit();
139     }
140
141     /**
142      * Sets the elementType.
143      * @param elementType The elementType to set
144      */

145     public void setElementType(QName JavaDoc elementType) {
146         Trc.entry(this, elementType);
147         this.elementType = elementType;
148         Trc.exit();
149     }
150
151     /**
152      * Sets the javaType.
153      * @param javaType The javaType to set
154      */

155     public void setJavaType(Class JavaDoc javaType) {
156         Trc.entry(this, javaType);
157         this.javaType = javaType;
158         Trc.exit();
159     }
160
161     /**
162      * Sets the serializer.
163      * @param serializer The serializer to set
164      */

165     public void setSerializer(Object JavaDoc serializer) {
166         Trc.entry(this, serializer);
167         this.serializer = serializer;
168         Trc.exit();
169     }
170
171     public String JavaDoc toString() {
172         return "[TypeSerializerInfo elementType="
173             + elementType
174             + ", "
175             + "javaType="
176             + javaType
177             + ", "
178             + "serializer="
179             + serializer
180             + ", "
181             + "deserializer="
182             + deserializer
183             + "]";
184     }
185
186 }
Popular Tags