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