1
2
3
4
5
6
7
8 package org.astrogrid.applications.beans.v1;
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 * description of an interface
26 *
27 * @version $Revision: 1.36 $ $Date: 2007/01/04 16:26:34 $
28 */
29 public class Interface extends org.astrogrid.common.bean.BaseBean
30 implements java.io.Serializable
31 {
32
33
34
35
36
37
38 /***
39 * Field _name
40 */
41 private java.lang.String _name;
42
43 /***
44 * The list of input paramters for an interface
45 */
46 private org.astrogrid.applications.beans.v1.Input _input;
47
48 /***
49 * The list of output parameters for an interface
50 */
51 private org.astrogrid.applications.beans.v1.Output _output;
52
53
54
55
56
57
58 public Interface() {
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 Interface) {
81
82 Interface temp = (Interface)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._input != null) {
91 if (temp._input == null) return false;
92 else if (!(this._input.equals(temp._input)))
93 return false;
94 }
95 else if (temp._input != null)
96 return false;
97 if (this._output != null) {
98 if (temp._output == null) return false;
99 else if (!(this._output.equals(temp._output)))
100 return false;
101 }
102 else if (temp._output != null)
103 return false;
104 return true;
105 }
106 return false;
107 }
108
109 /***
110 * Returns the value of field 'input'. The field 'input' has
111 * the following description: The list of input paramters for
112 * an interface
113 *
114 * @return the value of field 'input'.
115 */
116 public org.astrogrid.applications.beans.v1.Input getInput()
117 {
118 return this._input;
119 }
120
121 /***
122 * Returns the value of field 'name'.
123 *
124 * @return the value of field 'name'.
125 */
126 public java.lang.String getName()
127 {
128 return this._name;
129 }
130
131 /***
132 * Returns the value of field 'output'. The field 'output' has
133 * the following description: The list of output parameters for
134 * an interface
135 *
136 * @return the value of field 'output'.
137 */
138 public org.astrogrid.applications.beans.v1.Output getOutput()
139 {
140 return this._output;
141 }
142
143 /***
144 * Method isValid
145 */
146 public boolean isValid()
147 {
148 try {
149 validate();
150 }
151 catch (org.exolab.castor.xml.ValidationException vex) {
152 return false;
153 }
154 return true;
155 }
156
157 /***
158 * Method marshal
159 *
160 * @param out
161 */
162 public void marshal(java.io.Writer out)
163 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
164 {
165
166 Marshaller.marshal(this, out);
167 }
168
169 /***
170 * Method marshal
171 *
172 * @param handler
173 */
174 public void marshal(org.xml.sax.ContentHandler handler)
175 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
176 {
177
178 Marshaller.marshal(this, handler);
179 }
180
181 /***
182 * Sets the value of field 'input'. The field 'input' has the
183 * following description: The list of input paramters for an
184 * interface
185 *
186 * @param input the value of field 'input'.
187 */
188 public void setInput(org.astrogrid.applications.beans.v1.Input input)
189 {
190 this._input = input;
191 }
192
193 /***
194 * Sets the value of field 'name'.
195 *
196 * @param name the value of field 'name'.
197 */
198 public void setName(java.lang.String name)
199 {
200 this._name = name;
201 }
202
203 /***
204 * Sets the value of field 'output'. The field 'output' has the
205 * following description: The list of output parameters for an
206 * interface
207 *
208 * @param output the value of field 'output'.
209 */
210 public void setOutput(org.astrogrid.applications.beans.v1.Output output)
211 {
212 this._output = output;
213 }
214
215 /***
216 * Method unmarshalInterface
217 *
218 * @param reader
219 */
220 public static org.astrogrid.applications.beans.v1.Interface unmarshalInterface(java.io.Reader reader)
221 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
222 {
223 return (org.astrogrid.applications.beans.v1.Interface) Unmarshaller.unmarshal(org.astrogrid.applications.beans.v1.Interface.class, reader);
224 }
225
226 /***
227 * Method validate
228 */
229 public void validate()
230 throws org.exolab.castor.xml.ValidationException
231 {
232 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
233 validator.validate(this);
234 }
235
236 }