1
2
3
4
5
6
7
8 package org.astrogrid.applications.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.astrogrid.applications.beans.v1.types.HttpMethodType;
19 import org.exolab.castor.xml.MarshalException;
20 import org.exolab.castor.xml.Marshaller;
21 import org.exolab.castor.xml.Unmarshaller;
22 import org.exolab.castor.xml.ValidationException;
23 import org.xml.sax.ContentHandler;
24
25 /***
26 * The URL for an http get or post service
27 *
28 * @version $Revision: 1.8 $ $Date: 2007/01/04 16:26:34 $
29 */
30 public class HttpURLType extends org.astrogrid.common.bean.BaseBean
31 implements java.io.Serializable
32 {
33
34
35
36
37
38
39 /***
40 * internal content storage
41 */
42 private java.lang.String _content = "";
43
44 /***
45 * Field _method
46 */
47 private org.astrogrid.applications.beans.v1.types.HttpMethodType _method = org.astrogrid.applications.beans.v1.types.HttpMethodType.valueOf("get");
48
49
50
51
52
53
54 public HttpURLType() {
55 super();
56 setContent("");
57 setMethod(org.astrogrid.applications.beans.v1.types.HttpMethodType.valueOf("get"));
58 }
59
60
61
62
63
64
65 /***
66 * Note: hashCode() has not been overriden
67 *
68 * @param obj
69 */
70 public boolean equals(java.lang.Object obj)
71 {
72 if ( this == obj )
73 return true;
74
75 if (super.equals(obj)==false)
76 return false;
77
78 if (obj instanceof HttpURLType) {
79
80 HttpURLType temp = (HttpURLType)obj;
81 if (this._content != null) {
82 if (temp._content == null) return false;
83 else if (!(this._content.equals(temp._content)))
84 return false;
85 }
86 else if (temp._content != null)
87 return false;
88 if (this._method != null) {
89 if (temp._method == null) return false;
90 else if (!(this._method.equals(temp._method)))
91 return false;
92 }
93 else if (temp._method != null)
94 return false;
95 return true;
96 }
97 return false;
98 }
99
100 /***
101 * Returns the value of field 'content'. The field 'content'
102 * has the following description: internal content storage
103 *
104 * @return the value of field 'content'.
105 */
106 public java.lang.String getContent()
107 {
108 return this._content;
109 }
110
111 /***
112 * Returns the value of field 'method'.
113 *
114 * @return the value of field 'method'.
115 */
116 public org.astrogrid.applications.beans.v1.types.HttpMethodType getMethod()
117 {
118 return this._method;
119 }
120
121 /***
122 * Method isValid
123 */
124 public boolean isValid()
125 {
126 try {
127 validate();
128 }
129 catch (org.exolab.castor.xml.ValidationException vex) {
130 return false;
131 }
132 return true;
133 }
134
135 /***
136 * Method marshal
137 *
138 * @param out
139 */
140 public void marshal(java.io.Writer out)
141 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
142 {
143
144 Marshaller.marshal(this, out);
145 }
146
147 /***
148 * Method marshal
149 *
150 * @param handler
151 */
152 public void marshal(org.xml.sax.ContentHandler handler)
153 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
154 {
155
156 Marshaller.marshal(this, handler);
157 }
158
159 /***
160 * Sets the value of field 'content'. The field 'content' has
161 * the following description: internal content storage
162 *
163 * @param content the value of field 'content'.
164 */
165 public void setContent(java.lang.String content)
166 {
167 this._content = content;
168 }
169
170 /***
171 * Sets the value of field 'method'.
172 *
173 * @param method the value of field 'method'.
174 */
175 public void setMethod(org.astrogrid.applications.beans.v1.types.HttpMethodType method)
176 {
177 this._method = method;
178 }
179
180 /***
181 * Method unmarshalHttpURLType
182 *
183 * @param reader
184 */
185 public static org.astrogrid.applications.beans.v1.HttpURLType unmarshalHttpURLType(java.io.Reader reader)
186 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
187 {
188 return (org.astrogrid.applications.beans.v1.HttpURLType) Unmarshaller.unmarshal(org.astrogrid.applications.beans.v1.HttpURLType.class, reader);
189 }
190
191 /***
192 * Method validate
193 */
194 public void validate()
195 throws org.exolab.castor.xml.ValidationException
196 {
197 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
198 validator.validate(this);
199 }
200
201 }