Java binding for new document schema (from 1st hinxton vamsas Meeting)
[vamsas.git] / src / org / vamsas / objects / core / Glyph.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 org.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  * Discrete symbol - possibly graphically\r
26  *  represented\r
27  *  \r
28  * \r
29  * @version $Revision$ $Date$\r
30  */\r
31 public class Glyph extends org.vamsas.client.Vobject \r
32 implements java.io.Serializable\r
33 {\r
34 \r
35 \r
36       //--------------------------/\r
37      //- Class/Member Variables -/\r
38     //--------------------------/\r
39 \r
40     /**\r
41      * internal content storage\r
42      */\r
43     private java.lang.String _content = "";\r
44 \r
45     /**\r
46      * specifies the symbol\r
47      *  dictionary for this glyph -\r
48      *  eg utf8 (the default),\r
49      *  aasecstr_3 or\r
50      *  kd_hydrophobicity - the\r
51      *  content is not validated so\r
52      *  applications must ensure\r
53      *  they gracefully deal with\r
54      *  invalid entries here\r
55      *  \r
56      */\r
57     private java.lang.String _dict = "utf8";\r
58 \r
59 \r
60       //----------------/\r
61      //- Constructors -/\r
62     //----------------/\r
63 \r
64     public Glyph() \r
65      {\r
66         super();\r
67         setContent("");\r
68         setDict("utf8");\r
69     } //-- org.vamsas.objects.core.Glyph()\r
70 \r
71 \r
72       //-----------/\r
73      //- Methods -/\r
74     //-----------/\r
75 \r
76     /**\r
77      * Note: hashCode() has not been overriden\r
78      * \r
79      * @param obj\r
80      * @return boolean\r
81      */\r
82     public boolean equals(java.lang.Object obj)\r
83     {\r
84         if ( this == obj )\r
85             return true;\r
86         \r
87         if (super.equals(obj)==false)\r
88             return false;\r
89         \r
90         if (obj instanceof Glyph) {\r
91         \r
92             Glyph temp = (Glyph)obj;\r
93             if (this._content != null) {\r
94                 if (temp._content == null) return false;\r
95                 else if (!(this._content.equals(temp._content))) \r
96                     return false;\r
97             }\r
98             else if (temp._content != null)\r
99                 return false;\r
100             if (this._dict != null) {\r
101                 if (temp._dict == null) return false;\r
102                 else if (!(this._dict.equals(temp._dict))) \r
103                     return false;\r
104             }\r
105             else if (temp._dict != null)\r
106                 return false;\r
107             return true;\r
108         }\r
109         return false;\r
110     } //-- boolean equals(java.lang.Object) \r
111 \r
112     /**\r
113      * Returns the value of field 'content'. The field 'content'\r
114      * has the following description: internal content storage\r
115      * \r
116      * @return String\r
117      * @return the value of field 'content'.\r
118      */\r
119     public java.lang.String getContent()\r
120     {\r
121         return this._content;\r
122     } //-- java.lang.String getContent() \r
123 \r
124     /**\r
125      * Returns the value of field 'dict'. The field 'dict' has the\r
126      * following description: specifies the symbol\r
127      *  dictionary for this glyph -\r
128      *  eg utf8 (the default),\r
129      *  aasecstr_3 or\r
130      *  kd_hydrophobicity - the\r
131      *  content is not validated so\r
132      *  applications must ensure\r
133      *  they gracefully deal with\r
134      *  invalid entries here\r
135      *  \r
136      * \r
137      * @return String\r
138      * @return the value of field 'dict'.\r
139      */\r
140     public java.lang.String getDict()\r
141     {\r
142         return this._dict;\r
143     } //-- java.lang.String getDict() \r
144 \r
145     /**\r
146      * Method isValid\r
147      * \r
148      * \r
149      * \r
150      * @return boolean\r
151      */\r
152     public boolean isValid()\r
153     {\r
154         try {\r
155             validate();\r
156         }\r
157         catch (org.exolab.castor.xml.ValidationException vex) {\r
158             return false;\r
159         }\r
160         return true;\r
161     } //-- boolean isValid() \r
162 \r
163     /**\r
164      * Method marshal\r
165      * \r
166      * \r
167      * \r
168      * @param out\r
169      */\r
170     public void marshal(java.io.Writer out)\r
171         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
172     {\r
173         \r
174         Marshaller.marshal(this, out);\r
175     } //-- void marshal(java.io.Writer) \r
176 \r
177     /**\r
178      * Method marshal\r
179      * \r
180      * \r
181      * \r
182      * @param handler\r
183      */\r
184     public void marshal(org.xml.sax.ContentHandler handler)\r
185         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
186     {\r
187         \r
188         Marshaller.marshal(this, handler);\r
189     } //-- void marshal(org.xml.sax.ContentHandler) \r
190 \r
191     /**\r
192      * Sets the value of field 'content'. The field 'content' has\r
193      * the following description: internal content storage\r
194      * \r
195      * @param content the value of field 'content'.\r
196      */\r
197     public void setContent(java.lang.String content)\r
198     {\r
199         this._content = content;\r
200     } //-- void setContent(java.lang.String) \r
201 \r
202     /**\r
203      * Sets the value of field 'dict'. The field 'dict' has the\r
204      * following description: specifies the symbol\r
205      *  dictionary for this glyph -\r
206      *  eg utf8 (the default),\r
207      *  aasecstr_3 or\r
208      *  kd_hydrophobicity - the\r
209      *  content is not validated so\r
210      *  applications must ensure\r
211      *  they gracefully deal with\r
212      *  invalid entries here\r
213      *  \r
214      * \r
215      * @param dict the value of field 'dict'.\r
216      */\r
217     public void setDict(java.lang.String dict)\r
218     {\r
219         this._dict = dict;\r
220     } //-- void setDict(java.lang.String) \r
221 \r
222     /**\r
223      * Method unmarshal\r
224      * \r
225      * \r
226      * \r
227      * @param reader\r
228      * @return Glyph\r
229      */\r
230     public static org.vamsas.objects.core.Glyph unmarshal(java.io.Reader reader)\r
231         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
232     {\r
233         return (org.vamsas.objects.core.Glyph) Unmarshaller.unmarshal(org.vamsas.objects.core.Glyph.class, reader);\r
234     } //-- org.vamsas.objects.core.Glyph unmarshal(java.io.Reader) \r
235 \r
236     /**\r
237      * Method validate\r
238      * \r
239      */\r
240     public void validate()\r
241         throws org.exolab.castor.xml.ValidationException\r
242     {\r
243         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
244         validator.validate(this);\r
245     } //-- void validate() \r
246 \r
247 }\r