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 * a collection of activities to be performed potentially in
26 * parallel
27 *
28 * @version $Revision: 1.36 $ $Date: 2007/01/04 16:26:27 $
29 */
30 public class Flow extends org.astrogrid.workflow.beans.v1.ActivityContainer
31 implements java.io.Serializable
32 {
33
34
35
36
37
38
39 public Flow() {
40 super();
41 }
42
43
44
45
46
47
48 /***
49 * Note: hashCode() has not been overriden
50 *
51 * @param obj
52 */
53 public boolean equals(java.lang.Object obj)
54 {
55 if ( this == obj )
56 return true;
57
58 if (super.equals(obj)==false)
59 return false;
60
61 if (obj instanceof Flow) {
62
63 Flow temp = (Flow)obj;
64 return true;
65 }
66 return false;
67 }
68
69 /***
70 * Method isValid
71 */
72 public boolean isValid()
73 {
74 try {
75 validate();
76 }
77 catch (org.exolab.castor.xml.ValidationException vex) {
78 return false;
79 }
80 return true;
81 }
82
83 /***
84 * Method marshal
85 *
86 * @param out
87 */
88 public void marshal(java.io.Writer out)
89 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
90 {
91
92 Marshaller.marshal(this, out);
93 }
94
95 /***
96 * Method marshal
97 *
98 * @param handler
99 */
100 public void marshal(org.xml.sax.ContentHandler handler)
101 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
102 {
103
104 Marshaller.marshal(this, handler);
105 }
106
107 /***
108 * Method unmarshalFlow
109 *
110 * @param reader
111 */
112 public static org.astrogrid.workflow.beans.v1.Flow unmarshalFlow(java.io.Reader reader)
113 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
114 {
115 return (org.astrogrid.workflow.beans.v1.Flow) Unmarshaller.unmarshal(org.astrogrid.workflow.beans.v1.Flow.class, reader);
116 }
117
118 /***
119 * Method validate
120 */
121 public void validate()
122 throws org.exolab.castor.xml.ValidationException
123 {
124 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
125 validator.validate(this);
126 }
127
128 }