View Javadoc

1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 0.9.4.3</a>, using an XML
4    * Schema.
5    * $Id: Tool.java,v 1.36 2007/01/04 16:26:27 clq2 Exp $
6    */
7   
8   package org.astrogrid.workflow.beans.v1;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
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   * represents a call to a CEA application 
26   * 
27   * @version $Revision: 1.36 $ $Date: 2007/01/04 16:26:27 $
28   */
29  public class Tool extends org.astrogrid.common.bean.BaseBean 
30  implements java.io.Serializable
31  {
32  
33  
34        //--------------------------/
35       //- Class/Member Variables -/
36      //--------------------------/
37  
38      /***
39       * name of the application to call
40       */
41      private java.lang.String _name;
42  
43      /***
44       * which interface of the application to call
45       */
46      private java.lang.String _interface;
47  
48      /***
49       * the list of input parameters
50       */
51      private org.astrogrid.workflow.beans.v1.Input _input;
52  
53      /***
54       * the list of output paramters
55       */
56      private org.astrogrid.workflow.beans.v1.Output _output;
57  
58  
59        //----------------/
60       //- Constructors -/
61      //----------------/
62  
63      public Tool() {
64          super();
65      } //-- org.astrogrid.workflow.beans.v1.Tool()
66  
67  
68        //-----------/
69       //- Methods -/
70      //-----------/
71  
72      /***
73       * Note: hashCode() has not been overriden
74       * 
75       * @param obj
76       */
77      public boolean equals(java.lang.Object obj)
78      {
79          if ( this == obj )
80              return true;
81          
82          if (super.equals(obj)==false)
83              return false;
84          
85          if (obj instanceof Tool) {
86          
87              Tool temp = (Tool)obj;
88              if (this._name != null) {
89                  if (temp._name == null) return false;
90                  else if (!(this._name.equals(temp._name))) 
91                      return false;
92              }
93              else if (temp._name != null)
94                  return false;
95              if (this._interface != null) {
96                  if (temp._interface == null) return false;
97                  else if (!(this._interface.equals(temp._interface))) 
98                      return false;
99              }
100             else if (temp._interface != null)
101                 return false;
102             if (this._input != null) {
103                 if (temp._input == null) return false;
104                 else if (!(this._input.equals(temp._input))) 
105                     return false;
106             }
107             else if (temp._input != null)
108                 return false;
109             if (this._output != null) {
110                 if (temp._output == null) return false;
111                 else if (!(this._output.equals(temp._output))) 
112                     return false;
113             }
114             else if (temp._output != null)
115                 return false;
116             return true;
117         }
118         return false;
119     } //-- boolean equals(java.lang.Object) 
120 
121     /***
122      * Returns the value of field 'input'. The field 'input' has
123      * the following description: the list of input parameters
124      * 
125      * @return the value of field 'input'.
126      */
127     public org.astrogrid.workflow.beans.v1.Input getInput()
128     {
129         return this._input;
130     } //-- org.astrogrid.workflow.beans.v1.Input getInput() 
131 
132     /***
133      * Returns the value of field 'interface'. The field
134      * 'interface' has the following description: which interface
135      * of the application to call
136      * 
137      * @return the value of field 'interface'.
138      */
139     public java.lang.String getInterface()
140     {
141         return this._interface;
142     } //-- java.lang.String getInterface() 
143 
144     /***
145      * Returns the value of field 'name'. The field 'name' has the
146      * following description: name of the application to call
147      * 
148      * @return the value of field 'name'.
149      */
150     public java.lang.String getName()
151     {
152         return this._name;
153     } //-- java.lang.String getName() 
154 
155     /***
156      * Returns the value of field 'output'. The field 'output' has
157      * the following description: the list of output paramters
158      * 
159      * @return the value of field 'output'.
160      */
161     public org.astrogrid.workflow.beans.v1.Output getOutput()
162     {
163         return this._output;
164     } //-- org.astrogrid.workflow.beans.v1.Output getOutput() 
165 
166     /***
167      * Method isValid
168      */
169     public boolean isValid()
170     {
171         try {
172             validate();
173         }
174         catch (org.exolab.castor.xml.ValidationException vex) {
175             return false;
176         }
177         return true;
178     } //-- boolean isValid() 
179 
180     /***
181      * Method marshal
182      * 
183      * @param out
184      */
185     public void marshal(java.io.Writer out)
186         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
187     {
188         
189         Marshaller.marshal(this, out);
190     } //-- void marshal(java.io.Writer) 
191 
192     /***
193      * Method marshal
194      * 
195      * @param handler
196      */
197     public void marshal(org.xml.sax.ContentHandler handler)
198         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
199     {
200         
201         Marshaller.marshal(this, handler);
202     } //-- void marshal(org.xml.sax.ContentHandler) 
203 
204     /***
205      * Sets the value of field 'input'. The field 'input' has the
206      * following description: the list of input parameters
207      * 
208      * @param input the value of field 'input'.
209      */
210     public void setInput(org.astrogrid.workflow.beans.v1.Input input)
211     {
212         this._input = input;
213     } //-- void setInput(org.astrogrid.workflow.beans.v1.Input) 
214 
215     /***
216      * Sets the value of field 'interface'. The field 'interface'
217      * has the following description: which interface of the
218      * application to call
219      * 
220      * @param _interface
221      * @param interface the value of field 'interface'.
222      */
223     public void setInterface(java.lang.String _interface)
224     {
225         this._interface = _interface;
226     } //-- void setInterface(java.lang.String) 
227 
228     /***
229      * Sets the value of field 'name'. The field 'name' has the
230      * following description: name of the application to call
231      * 
232      * @param name the value of field 'name'.
233      */
234     public void setName(java.lang.String name)
235     {
236         this._name = name;
237     } //-- void setName(java.lang.String) 
238 
239     /***
240      * Sets the value of field 'output'. The field 'output' has the
241      * following description: the list of output paramters
242      * 
243      * @param output the value of field 'output'.
244      */
245     public void setOutput(org.astrogrid.workflow.beans.v1.Output output)
246     {
247         this._output = output;
248     } //-- void setOutput(org.astrogrid.workflow.beans.v1.Output) 
249 
250     /***
251      * Method unmarshalTool
252      * 
253      * @param reader
254      */
255     public static org.astrogrid.workflow.beans.v1.Tool unmarshalTool(java.io.Reader reader)
256         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
257     {
258         return (org.astrogrid.workflow.beans.v1.Tool) Unmarshaller.unmarshal(org.astrogrid.workflow.beans.v1.Tool.class, reader);
259     } //-- org.astrogrid.workflow.beans.v1.Tool unmarshalTool(java.io.Reader) 
260 
261     /***
262      * Method validate
263      */
264     public void validate()
265         throws org.exolab.castor.xml.ValidationException
266     {
267         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
268         validator.validate(this);
269     } //-- void validate() 
270 
271 }