1
2
3
4
5
6
7
8 package org.astrogrid.workflow.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 * Branch to take when if condition evaluates to true
26 *
27 * @version $Revision: 1.13 $ $Date: 2007/01/04 16:26:26 $
28 */
29 public class Then extends org.astrogrid.common.bean.BaseBean
30 implements java.io.Serializable
31 {
32
33
34
35
36
37
38 /***
39 * Head of the substitution group
40 */
41 private org.astrogrid.workflow.beans.v1.AbstractActivity _activity;
42
43
44
45
46
47
48 public Then() {
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 Then) {
71
72 Then temp = (Then)obj;
73 if (this._activity != null) {
74 if (temp._activity == null) return false;
75 else if (!(this._activity.equals(temp._activity)))
76 return false;
77 }
78 else if (temp._activity != null)
79 return false;
80 return true;
81 }
82 return false;
83 }
84
85 /***
86 * Returns the value of field 'activity'. The field 'activity'
87 * has the following description: Head of the substitution
88 * group
89 *
90 * @return the value of field 'activity'.
91 */
92 public org.astrogrid.workflow.beans.v1.AbstractActivity getActivity()
93 {
94 return this._activity;
95 }
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 }
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 }
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 }
134
135 /***
136 * Sets the value of field 'activity'. The field 'activity' has
137 * the following description: Head of the substitution group
138 *
139 * @param activity the value of field 'activity'.
140 */
141 public void setActivity(org.astrogrid.workflow.beans.v1.AbstractActivity activity)
142 {
143 this._activity = activity;
144 }
145
146 /***
147 * Method unmarshalThen
148 *
149 * @param reader
150 */
151 public static org.astrogrid.workflow.beans.v1.Then unmarshalThen(java.io.Reader reader)
152 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
153 {
154 return (org.astrogrid.workflow.beans.v1.Then) Unmarshaller.unmarshal(org.astrogrid.workflow.beans.v1.Then.class, reader);
155 }
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 }
166
167 }