1
2
3
4
5
6
7
8 package org.astrogrid.registry.beans.v10.resource;
9
10
11
12
13
14 import java.io.IOException;
15 import java.io.Reader;
16 import java.io.Serializable;
17 import java.io.Writer;
18 import org.exolab.castor.xml.MarshalException;
19 import org.exolab.castor.xml.Marshaller;
20 import org.exolab.castor.xml.Unmarshaller;
21 import org.exolab.castor.xml.ValidationException;
22 import org.xml.sax.ContentHandler;
23
24 /***
25 * The entity (e.g. person or organisation) primarily responsible
26 * for creating something
27 *
28 *
29 * @version $Revision: 1.2 $ $Date: 2007/01/04 16:26:24 $
30 */
31 public class Creator extends org.astrogrid.common.bean.BaseBean
32 implements java.io.Serializable
33 {
34
35
36
37
38
39
40 /***
41 * the name or title of the creating person or organization
42 *
43 */
44 private org.astrogrid.registry.beans.v10.resource.ResourceName _name;
45
46 /***
47 * URL pointing to a graphical logo, which may be used to help
48 * identify the information source
49 *
50 */
51 private java.lang.String _logo;
52
53
54
55
56
57
58 public Creator() {
59 super();
60 }
61
62
63
64
65
66
67 /***
68 * Note: hashCode() has not been overriden
69 *
70 * @param obj
71 */
72 public boolean equals(java.lang.Object obj)
73 {
74 if ( this == obj )
75 return true;
76
77 if (super.equals(obj)==false)
78 return false;
79
80 if (obj instanceof Creator) {
81
82 Creator temp = (Creator)obj;
83 if (this._name != null) {
84 if (temp._name == null) return false;
85 else if (!(this._name.equals(temp._name)))
86 return false;
87 }
88 else if (temp._name != null)
89 return false;
90 if (this._logo != null) {
91 if (temp._logo == null) return false;
92 else if (!(this._logo.equals(temp._logo)))
93 return false;
94 }
95 else if (temp._logo != null)
96 return false;
97 return true;
98 }
99 return false;
100 }
101
102 /***
103 * Returns the value of field 'logo'. The field 'logo' has the
104 * following description: URL pointing to a graphical logo,
105 * which may be used to help
106 * identify the information source
107 *
108 *
109 * @return the value of field 'logo'.
110 */
111 public java.lang.String getLogo()
112 {
113 return this._logo;
114 }
115
116 /***
117 * Returns the value of field 'name'. The field 'name' has the
118 * following description: the name or title of the creating
119 * person or organization
120 *
121 *
122 * @return the value of field 'name'.
123 */
124 public org.astrogrid.registry.beans.v10.resource.ResourceName getName()
125 {
126 return this._name;
127 }
128
129 /***
130 * Method isValid
131 */
132 public boolean isValid()
133 {
134 try {
135 validate();
136 }
137 catch (org.exolab.castor.xml.ValidationException vex) {
138 return false;
139 }
140 return true;
141 }
142
143 /***
144 * Method marshal
145 *
146 * @param out
147 */
148 public void marshal(java.io.Writer out)
149 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
150 {
151
152 Marshaller.marshal(this, out);
153 }
154
155 /***
156 * Method marshal
157 *
158 * @param handler
159 */
160 public void marshal(org.xml.sax.ContentHandler handler)
161 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
162 {
163
164 Marshaller.marshal(this, handler);
165 }
166
167 /***
168 * Sets the value of field 'logo'. The field 'logo' has the
169 * following description: URL pointing to a graphical logo,
170 * which may be used to help
171 * identify the information source
172 *
173 *
174 * @param logo the value of field 'logo'.
175 */
176 public void setLogo(java.lang.String logo)
177 {
178 this._logo = logo;
179 }
180
181 /***
182 * Sets the value of field 'name'. The field 'name' has the
183 * following description: the name or title of the creating
184 * person or organization
185 *
186 *
187 * @param name the value of field 'name'.
188 */
189 public void setName(org.astrogrid.registry.beans.v10.resource.ResourceName name)
190 {
191 this._name = name;
192 }
193
194 /***
195 * Method unmarshalCreator
196 *
197 * @param reader
198 */
199 public static org.astrogrid.registry.beans.v10.resource.Creator unmarshalCreator(java.io.Reader reader)
200 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
201 {
202 return (org.astrogrid.registry.beans.v10.resource.Creator) Unmarshaller.unmarshal(org.astrogrid.registry.beans.v10.resource.Creator.class, reader);
203 }
204
205 /***
206 * Method validate
207 */
208 public void validate()
209 throws org.exolab.castor.xml.ValidationException
210 {
211 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
212 validator.validate(this);
213 }
214
215 }