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