KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > net > axis > ParameterizableDeserializerFactory


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 // $Id: ParameterizableDeserializerFactory.java,v 1.6.6.1 2005/03/02 14:19:53 tdiesler Exp $
9

10 package org.jboss.net.axis;
11
12 import org.jboss.axis.encoding.ser.BaseDeserializerFactory;
13
14 import javax.xml.namespace.QName JavaDoc;
15 import java.util.Map JavaDoc;
16
17 /**
18  * Deserializer Factory that may be parameterized with additional
19  * options.
20  * <br>
21  * <h3>Change History</h3>
22  * <ul>
23  * </ul>
24  * @created 06.04.2002
25  * @author <a HREF="mailto:Christoph.Jung@infor.de">Christoph G. Jung</a>
26  * @version $Revision: 1.6.6.1 $
27  */

28
29 public class ParameterizableDeserializerFactory extends BaseDeserializerFactory
30 {
31
32    //
33
// Attributes
34
//
35

36    protected Map JavaDoc options;
37     
38    //
39
// Constructors
40
//
41

42    /** regular constructor */
43    public ParameterizableDeserializerFactory(Class JavaDoc deserializerType, Class JavaDoc javaType, QName JavaDoc xmlType)
44    {
45       super(deserializerType, xmlType, javaType);
46    }
47
48    /** the extended constructor that is parameterized */
49    public ParameterizableDeserializerFactory(Class JavaDoc deserializerType, Class JavaDoc javaType, QName JavaDoc xmlType, Map JavaDoc options)
50    {
51       super(deserializerType, xmlType, javaType);
52       this.options = options;
53    }
54
55    //
56
// public API
57
//
58

59    /** return options */
60    protected Map JavaDoc getOptions()
61    {
62       return options;
63    }
64
65    /** set options */
66    protected void setOptions(Map JavaDoc options)
67    {
68       this.options = options;
69    }
70
71    /** return a new deserializer that we equip with the right options */
72    public javax.xml.rpc.encoding.Deserializer JavaDoc getDeserializerAs(String JavaDoc mechanismType)
73    {
74       javax.xml.rpc.encoding.Deserializer JavaDoc deser = super.getDeserializerAs(mechanismType);
75       if (deser instanceof ParameterizableDeserializer)
76       {
77          ((ParameterizableDeserializer)deser).setOptions(options);
78       }
79       return deser;
80    }
81
82 }
83
Popular Tags