KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > encoding > ser > ArrayDeserializerFactory


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.encoding.ser;
18
19 import javax.xml.namespace.QName JavaDoc;
20
21
22 /**
23  * DeserializerFactory for arrays
24  *
25  * @author Rich Scheuerle <scheu@us.ibm.com>
26  */

27 public class ArrayDeserializerFactory extends BaseDeserializerFactory {
28     private QName JavaDoc componentXmlType;
29
30     public ArrayDeserializerFactory() {
31         super(ArrayDeserializer.class);
32     }
33
34     /**
35      * Constructor
36      * @param componentXmlType the desired component type for this deser
37      */

38     public ArrayDeserializerFactory(QName JavaDoc componentXmlType) {
39         super(ArrayDeserializer.class);
40         this.componentXmlType = componentXmlType;
41     }
42
43     /**
44      * getDeserializerAs() is overloaded here in order to set the default
45      * item type on the ArrayDeserializers we create.
46      *
47      * @param mechanismType
48      * @return
49      */

50     public javax.xml.rpc.encoding.Deserializer JavaDoc getDeserializerAs(String JavaDoc mechanismType) {
51         ArrayDeserializer dser = (ArrayDeserializer) super.getDeserializerAs(mechanismType);
52         dser.defaultItemType = componentXmlType;
53         return dser;
54     }
55
56     public void setComponentType(QName JavaDoc componentType) {
57         componentXmlType = componentType;
58     }
59 }
Popular Tags