KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > scalagent > ksoap > SoapPrimitive


1 /*
2  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
3  * Copyright (C) 2003 - ScalAgent Distributed Technologies
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18  * USA.
19  *
20  * The present code contributor is ScalAgent Distributed Technologies.
21  *
22  * Initial developer(s): Nicolas Tachker (ScalAgent)
23  * Contributor(s):
24  */

25 package com.scalagent.ksoap;
26
27 import com.scalagent.ksoap.marshal.Marshal;
28
29 public class SoapPrimitive {
30
31   String JavaDoc namespace;
32   String JavaDoc name;
33   Class JavaDoc clazz;
34   Marshal marshal;
35
36   public SoapPrimitive(String JavaDoc namespace,
37                        String JavaDoc name,
38                        Class JavaDoc clazz,
39                        Marshal marshal) {
40     this.namespace = namespace;
41     this.name = name;
42     this.clazz = clazz;
43     this.marshal = marshal;
44   }
45
46   public boolean equals(Object JavaDoc o) {
47     if (!(o instanceof SoapPrimitive)) return false;
48     SoapPrimitive p = (SoapPrimitive) o;
49     return name.equals(p.name) && namespace.equals(p.namespace);
50   }
51
52   public int hashCode() {
53     return name.hashCode() ^ namespace.hashCode();
54   }
55
56   public String JavaDoc getNameSpace() {
57     return namespace;
58   }
59
60   public String JavaDoc getName() {
61     return name;
62   }
63
64   public String JavaDoc getClassName() {
65     return clazz.getName();
66   }
67
68   public Marshal getMarshal() {
69     return marshal;
70   }
71
72   public String JavaDoc toString() {
73     return "SoapPrimitive(" +
74       namespace + "," +
75       name + "," +
76       clazz + "," +
77       marshal + ")";
78   }
79 }
80
81
Popular Tags