refactored org to uk
[vamsas.git] / src / uk / ac / vamsas / objects / core / Mapping.java
1 /*\r
2  * This class was automatically generated with \r
3  * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML\r
4  * Schema.\r
5  * $Id$\r
6  */\r
7 \r
8 package uk.ac.vamsas.objects.core;\r
9 \r
10   //---------------------------------/\r
11  //- Imported classes and packages -/\r
12 //---------------------------------/\r
13 \r
14 import java.io.IOException;\r
15 import java.io.Reader;\r
16 import java.io.Serializable;\r
17 import java.io.Writer;\r
18 import org.exolab.castor.xml.MarshalException;\r
19 import org.exolab.castor.xml.Marshaller;\r
20 import org.exolab.castor.xml.Unmarshaller;\r
21 import org.exolab.castor.xml.ValidationException;\r
22 import org.xml.sax.ContentHandler;\r
23 \r
24 /**\r
25  * Class Mapping.\r
26  * \r
27  * @version $Revision$ $Date$\r
28  */\r
29 public class Mapping extends uk.ac.vamsas.objects.core.MapList \r
30 implements java.io.Serializable\r
31 {\r
32 \r
33 \r
34       //--------------------------/\r
35      //- Class/Member Variables -/\r
36     //--------------------------/\r
37 \r
38     /**\r
39      * object to which the mapping is being mapped\r
40      *  \r
41      */\r
42     private java.lang.Object _onto;\r
43 \r
44 \r
45       //----------------/\r
46      //- Constructors -/\r
47     //----------------/\r
48 \r
49     public Mapping() \r
50      {\r
51         super();\r
52     } //-- uk.ac.vamsas.objects.core.Mapping()\r
53 \r
54 \r
55       //-----------/\r
56      //- Methods -/\r
57     //-----------/\r
58 \r
59     /**\r
60      * Note: hashCode() has not been overriden\r
61      * \r
62      * @param obj\r
63      * @return boolean\r
64      */\r
65     public boolean equals(java.lang.Object obj)\r
66     {\r
67         if ( this == obj )\r
68             return true;\r
69         \r
70         if (super.equals(obj)==false)\r
71             return false;\r
72         \r
73         if (obj instanceof Mapping) {\r
74         \r
75             Mapping temp = (Mapping)obj;\r
76             if (this._onto != null) {\r
77                 if (temp._onto == null) return false;\r
78                 else if (!(this._onto.equals(temp._onto))) \r
79                     return false;\r
80             }\r
81             else if (temp._onto != null)\r
82                 return false;\r
83             return true;\r
84         }\r
85         return false;\r
86     } //-- boolean equals(java.lang.Object) \r
87 \r
88     /**\r
89      * Returns the value of field 'onto'. The field 'onto' has the\r
90      * following description: object to which the mapping is being\r
91      * mapped\r
92      *  \r
93      * \r
94      * @return Object\r
95      * @return the value of field 'onto'.\r
96      */\r
97     public java.lang.Object getOnto()\r
98     {\r
99         return this._onto;\r
100     } //-- java.lang.Object getOnto() \r
101 \r
102     /**\r
103      * Method isValid\r
104      * \r
105      * \r
106      * \r
107      * @return boolean\r
108      */\r
109     public boolean isValid()\r
110     {\r
111         try {\r
112             validate();\r
113         }\r
114         catch (org.exolab.castor.xml.ValidationException vex) {\r
115             return false;\r
116         }\r
117         return true;\r
118     } //-- boolean isValid() \r
119 \r
120     /**\r
121      * Method marshal\r
122      * \r
123      * \r
124      * \r
125      * @param out\r
126      */\r
127     public void marshal(java.io.Writer out)\r
128         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
129     {\r
130         \r
131         Marshaller.marshal(this, out);\r
132     } //-- void marshal(java.io.Writer) \r
133 \r
134     /**\r
135      * Method marshal\r
136      * \r
137      * \r
138      * \r
139      * @param handler\r
140      */\r
141     public void marshal(org.xml.sax.ContentHandler handler)\r
142         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
143     {\r
144         \r
145         Marshaller.marshal(this, handler);\r
146     } //-- void marshal(org.xml.sax.ContentHandler) \r
147 \r
148     /**\r
149      * Sets the value of field 'onto'. The field 'onto' has the\r
150      * following description: object to which the mapping is being\r
151      * mapped\r
152      *  \r
153      * \r
154      * @param onto the value of field 'onto'.\r
155      */\r
156     public void setOnto(java.lang.Object onto)\r
157     {\r
158         this._onto = onto;\r
159     } //-- void setOnto(java.lang.Object) \r
160 \r
161     /**\r
162      * Method unmarshal\r
163      * \r
164      * \r
165      * \r
166      * @param reader\r
167      * @return MapList\r
168      */\r
169     public static uk.ac.vamsas.objects.core.MapList unmarshal(java.io.Reader reader)\r
170         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
171     {\r
172         return (uk.ac.vamsas.objects.core.Mapping) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Mapping.class, reader);\r
173     } //-- uk.ac.vamsas.objects.core.MapList unmarshal(java.io.Reader) \r
174 \r
175     /**\r
176      * Method validate\r
177      * \r
178      */\r
179     public void validate()\r
180         throws org.exolab.castor.xml.ValidationException\r
181     {\r
182         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
183         validator.validate(this);\r
184     } //-- void validate() \r
185 \r
186 }\r