1
2
3
4
5
6
7
8 package org.astrogrid.registry.beans.v10.resource.dataservice;
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 Web Service that is describable by a WSDL document.
26 *
27 * The accessURL element gives the URL to the WSDL document for
28 * the service.
29 *
30 *
31 * @version $Revision: 1.2 $ $Date: 2007/01/04 16:26:25 $
32 */
33 public class WebService extends org.astrogrid.registry.beans.v10.resource.Interface
34 implements java.io.Serializable
35 {
36
37
38
39
40
41
42 public WebService() {
43 super();
44 }
45
46
47
48
49
50
51 /***
52 * Note: hashCode() has not been overriden
53 *
54 * @param obj
55 */
56 public boolean equals(java.lang.Object obj)
57 {
58 if ( this == obj )
59 return true;
60
61 if (super.equals(obj)==false)
62 return false;
63
64 if (obj instanceof WebService) {
65
66 WebService temp = (WebService)obj;
67 return true;
68 }
69 return false;
70 }
71
72 /***
73 * Method isValid
74 */
75 public boolean isValid()
76 {
77 try {
78 validate();
79 }
80 catch (org.exolab.castor.xml.ValidationException vex) {
81 return false;
82 }
83 return true;
84 }
85
86 /***
87 * Method marshal
88 *
89 * @param out
90 */
91 public void marshal(java.io.Writer out)
92 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
93 {
94
95 Marshaller.marshal(this, out);
96 }
97
98 /***
99 * Method marshal
100 *
101 * @param handler
102 */
103 public void marshal(org.xml.sax.ContentHandler handler)
104 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
105 {
106
107 Marshaller.marshal(this, handler);
108 }
109
110 /***
111 * Method unmarshalWebService
112 *
113 * @param reader
114 */
115 public static org.astrogrid.registry.beans.v10.resource.dataservice.WebService unmarshalWebService(java.io.Reader reader)
116 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
117 {
118 return (org.astrogrid.registry.beans.v10.resource.dataservice.WebService) Unmarshaller.unmarshal(org.astrogrid.registry.beans.v10.resource.dataservice.WebService.class, reader);
119 }
120
121 /***
122 * Method validate
123 */
124 public void validate()
125 throws org.exolab.castor.xml.ValidationException
126 {
127 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
128 validator.validate(this);
129 }
130
131 }