1
2
3
4
5
6
7
8 package org.astrogrid.registry.beans.resource.registry;
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.astrogrid.registry.beans.resource.IdentifierType;
19 import org.exolab.castor.xml.MarshalException;
20 import org.exolab.castor.xml.Marshaller;
21 import org.exolab.castor.xml.Unmarshaller;
22 import org.exolab.castor.xml.ValidationException;
23 import org.xml.sax.ContentHandler;
24
25 /***
26 * Class AuthorityType.
27 *
28 * @version $Revision: 1.14 $ $Date: 2007/01/04 16:26:31 $
29 */
30 public class AuthorityType extends org.astrogrid.registry.beans.resource.ResourceType
31 implements java.io.Serializable
32 {
33
34
35
36
37
38
39 /***
40 * the organization that manages the current authority.
41 *
42 */
43 private org.astrogrid.registry.beans.resource.IdentifierType _managingOrg;
44
45
46
47
48
49
50 public AuthorityType() {
51 super();
52 }
53
54
55
56
57
58
59 /***
60 * Note: hashCode() has not been overriden
61 *
62 * @param obj
63 */
64 public boolean equals(java.lang.Object obj)
65 {
66 if ( this == obj )
67 return true;
68
69 if (super.equals(obj)==false)
70 return false;
71
72 if (obj instanceof AuthorityType) {
73
74 AuthorityType temp = (AuthorityType)obj;
75 if (this._managingOrg != null) {
76 if (temp._managingOrg == null) return false;
77 else if (!(this._managingOrg.equals(temp._managingOrg)))
78 return false;
79 }
80 else if (temp._managingOrg != null)
81 return false;
82 return true;
83 }
84 return false;
85 }
86
87 /***
88 * Returns the value of field 'managingOrg'. The field
89 * 'managingOrg' has the following description: the
90 * organization that manages the current authority.
91 *
92 *
93 * @return the value of field 'managingOrg'.
94 */
95 public org.astrogrid.registry.beans.resource.IdentifierType getManagingOrg()
96 {
97 return this._managingOrg;
98 }
99
100 /***
101 * Method isValid
102 */
103 public boolean isValid()
104 {
105 try {
106 validate();
107 }
108 catch (org.exolab.castor.xml.ValidationException vex) {
109 return false;
110 }
111 return true;
112 }
113
114 /***
115 * Method marshal
116 *
117 * @param out
118 */
119 public void marshal(java.io.Writer out)
120 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
121 {
122
123 Marshaller.marshal(this, out);
124 }
125
126 /***
127 * Method marshal
128 *
129 * @param handler
130 */
131 public void marshal(org.xml.sax.ContentHandler handler)
132 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
133 {
134
135 Marshaller.marshal(this, handler);
136 }
137
138 /***
139 * Sets the value of field 'managingOrg'. The field
140 * 'managingOrg' has the following description: the
141 * organization that manages the current authority.
142 *
143 *
144 * @param managingOrg the value of field 'managingOrg'.
145 */
146 public void setManagingOrg(org.astrogrid.registry.beans.resource.IdentifierType managingOrg)
147 {
148 this._managingOrg = managingOrg;
149 }
150
151 /***
152 * Method unmarshalAuthorityType
153 *
154 * @param reader
155 */
156 public static org.astrogrid.registry.beans.resource.registry.AuthorityType unmarshalAuthorityType(java.io.Reader reader)
157 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
158 {
159 return (org.astrogrid.registry.beans.resource.registry.AuthorityType) Unmarshaller.unmarshal(org.astrogrid.registry.beans.resource.registry.AuthorityType.class, reader);
160 }
161
162 /***
163 * Method validate
164 */
165 public void validate()
166 throws org.exolab.castor.xml.ValidationException
167 {
168 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
169 validator.validate(this);
170 }
171
172 }