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