cda263dc9818c5da9729e29039eac120f2156242
[vamsas.git] / src / uk / ac / vamsas / objects / core / Common.java
1 /*\r
2  * This class was automatically generated with \r
3  * <a href="http://www.castor.org">Castor 1.1</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 org.exolab.castor.xml.Marshaller;\r
15 import org.exolab.castor.xml.Unmarshaller;\r
16 \r
17 /**\r
18  * Class Common.\r
19  * \r
20  * @version $Revision$ $Date$\r
21  */\r
22 public class Common extends uk.ac.vamsas.objects.core.AppData \r
23 implements java.io.Serializable\r
24 {\r
25 \r
26 \r
27       //----------------/\r
28      //- Constructors -/\r
29     //----------------/\r
30 \r
31     public Common() {\r
32         super();\r
33     }\r
34 \r
35 \r
36       //-----------/\r
37      //- Methods -/\r
38     //-----------/\r
39 \r
40     /**\r
41      * Overrides the java.lang.Object.equals method.\r
42      * \r
43      * @param obj\r
44      * @return true if the objects are equal.\r
45      */\r
46     public boolean equals(\r
47             final java.lang.Object obj) {\r
48         if ( this == obj )\r
49             return true;\r
50         \r
51         if (super.equals(obj)==false)\r
52             return false;\r
53         \r
54         if (obj instanceof Common) {\r
55         \r
56         return true;\r
57     }\r
58     return false;\r
59     }\r
60 \r
61     /**\r
62      * Overrides the java.lang.Object.hashCode method.\r
63      * <p>\r
64      * The following steps came from <b>Effective Java Programming\r
65      * Language Guide</b> by Joshua Bloch, Chapter 3\r
66      * \r
67      * @return a hash code value for the object.\r
68      */\r
69     public int hashCode(\r
70     ) {\r
71         int result = super.hashCode();\r
72         \r
73         long tmp;\r
74         \r
75         return result;\r
76     }\r
77 \r
78     /**\r
79      * Method isValid.\r
80      * \r
81      * @return true if this object is valid according to the schema\r
82      */\r
83     public boolean isValid(\r
84     ) {\r
85         try {\r
86             validate();\r
87         } catch (org.exolab.castor.xml.ValidationException vex) {\r
88             return false;\r
89         }\r
90         return true;\r
91     }\r
92 \r
93     /**\r
94      * \r
95      * \r
96      * @param out\r
97      * @throws org.exolab.castor.xml.MarshalException if object is\r
98      * null or if any SAXException is thrown during marshaling\r
99      * @throws org.exolab.castor.xml.ValidationException if this\r
100      * object is an invalid instance according to the schema\r
101      */\r
102     public void marshal(\r
103             final java.io.Writer out)\r
104     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
105         Marshaller.marshal(this, out);\r
106     }\r
107 \r
108     /**\r
109      * \r
110      * \r
111      * @param handler\r
112      * @throws java.io.IOException if an IOException occurs during\r
113      * marshaling\r
114      * @throws org.exolab.castor.xml.ValidationException if this\r
115      * object is an invalid instance according to the schema\r
116      * @throws org.exolab.castor.xml.MarshalException if object is\r
117      * null or if any SAXException is thrown during marshaling\r
118      */\r
119     public void marshal(\r
120             final org.xml.sax.ContentHandler handler)\r
121     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
122         Marshaller.marshal(this, handler);\r
123     }\r
124 \r
125     /**\r
126      * Method unmarshal.\r
127      * \r
128      * @param reader\r
129      * @throws org.exolab.castor.xml.MarshalException if object is\r
130      * null or if any SAXException is thrown during marshaling\r
131      * @throws org.exolab.castor.xml.ValidationException if this\r
132      * object is an invalid instance according to the schema\r
133      * @return the unmarshaled uk.ac.vamsas.objects.core.AppData\r
134      */\r
135     public static uk.ac.vamsas.objects.core.AppData unmarshal(\r
136             final java.io.Reader reader)\r
137     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
138         return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Common.class, reader);\r
139     }\r
140 \r
141     /**\r
142      * \r
143      * \r
144      * @throws org.exolab.castor.xml.ValidationException if this\r
145      * object is an invalid instance according to the schema\r
146      */\r
147     public void validate(\r
148     )\r
149     throws org.exolab.castor.xml.ValidationException {\r
150         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
151         validator.validate(this);\r
152     }\r
153 \r
154 }\r