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 * forget a previously-declared workflow variable
26 *
27 * @version $Revision: 1.10 $ $Date: 2007/01/04 16:26:27 $
28 */
29 public class Unset extends org.astrogrid.workflow.beans.v1.AbstractActivity
30 implements java.io.Serializable
31 {
32
33
34
35
36
37
38 /***
39 * the name of the variabe to unset
40 */
41 private java.lang.String _var;
42
43
44
45
46
47
48 public Unset() {
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 Unset) {
71
72 Unset temp = (Unset)obj;
73 if (this._var != null) {
74 if (temp._var == null) return false;
75 else if (!(this._var.equals(temp._var)))
76 return false;
77 }
78 else if (temp._var != null)
79 return false;
80 return true;
81 }
82 return false;
83 }
84
85 /***
86 * Returns the value of field 'var'. The field 'var' has the
87 * following description: the name of the variabe to unset
88 *
89 * @return the value of field 'var'.
90 */
91 public java.lang.String getVar()
92 {
93 return this._var;
94 }
95
96 /***
97 * Method isValid
98 */
99 public boolean isValid()
100 {
101 try {
102 validate();
103 }
104 catch (org.exolab.castor.xml.ValidationException vex) {
105 return false;
106 }
107 return true;
108 }
109
110 /***
111 * Method marshal
112 *
113 * @param out
114 */
115 public void marshal(java.io.Writer out)
116 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
117 {
118
119 Marshaller.marshal(this, out);
120 }
121
122 /***
123 * Method marshal
124 *
125 * @param handler
126 */
127 public void marshal(org.xml.sax.ContentHandler handler)
128 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
129 {
130
131 Marshaller.marshal(this, handler);
132 }
133
134 /***
135 * Sets the value of field 'var'. The field 'var' has the
136 * following description: the name of the variabe to unset
137 *
138 * @param var the value of field 'var'.
139 */
140 public void setVar(java.lang.String var)
141 {
142 this._var = var;
143 }
144
145 /***
146 * Method unmarshalUnset
147 *
148 * @param reader
149 */
150 public static org.astrogrid.workflow.beans.v1.Unset unmarshalUnset(java.io.Reader reader)
151 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
152 {
153 return (org.astrogrid.workflow.beans.v1.Unset) Unmarshaller.unmarshal(org.astrogrid.workflow.beans.v1.Unset.class, reader);
154 }
155
156 /***
157 * Method validate
158 */
159 public void validate()
160 throws org.exolab.castor.xml.ValidationException
161 {
162 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
163 validator.validate(this);
164 }
165
166 }