View Javadoc

1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 0.9.4.3</a>, using an XML
4    * Schema.
5    * $Id: SIACapRestriction.java,v 1.2 2007/01/04 16:26:30 clq2 Exp $
6    */
7   
8   package org.astrogrid.registry.beans.v10.resource.sia;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
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   * an abstract capability that sets the standardURL to the
26   * ConeSearch
27   *  standard definition
28   *  
29   * 
30   * @version $Revision: 1.2 $ $Date: 2007/01/04 16:26:30 $
31   */
32  public class SIACapRestriction extends org.astrogrid.registry.beans.v10.resource.Capability 
33  implements java.io.Serializable
34  {
35  
36  
37        //--------------------------/
38       //- Class/Member Variables -/
39      //--------------------------/
40  
41      /***
42       * Field _standardID
43       */
44      private java.lang.String _standardID;
45  
46      /***
47       * Field _standardURL
48       */
49      private java.lang.String _standardURL = "http://www.us-vo.org/metadata/sia.html";
50  
51  
52        //----------------/
53       //- Constructors -/
54      //----------------/
55  
56      public SIACapRestriction() {
57          super();
58          setStandardURL("http://www.us-vo.org/metadata/sia.html");
59      } //-- org.astrogrid.registry.beans.v10.resource.sia.SIACapRestriction()
60  
61  
62        //-----------/
63       //- Methods -/
64      //-----------/
65  
66      /***
67       * Note: hashCode() has not been overriden
68       * 
69       * @param obj
70       */
71      public boolean equals(java.lang.Object obj)
72      {
73          if ( this == obj )
74              return true;
75          
76          if (super.equals(obj)==false)
77              return false;
78          
79          if (obj instanceof SIACapRestriction) {
80          
81              SIACapRestriction temp = (SIACapRestriction)obj;
82              if (this._standardID != null) {
83                  if (temp._standardID == null) return false;
84                  else if (!(this._standardID.equals(temp._standardID))) 
85                      return false;
86              }
87              else if (temp._standardID != null)
88                  return false;
89              if (this._standardURL != null) {
90                  if (temp._standardURL == null) return false;
91                  else if (!(this._standardURL.equals(temp._standardURL))) 
92                      return false;
93              }
94              else if (temp._standardURL != null)
95                  return false;
96              return true;
97          }
98          return false;
99      } //-- boolean equals(java.lang.Object) 
100 
101     /***
102      * Returns the value of field 'standardID'.
103      * 
104      * @return the value of field 'standardID'.
105      */
106     public java.lang.String getStandardID()
107     {
108         return this._standardID;
109     } //-- java.lang.String getStandardID() 
110 
111     /***
112      * Returns the value of field 'standardURL'.
113      * 
114      * @return the value of field 'standardURL'.
115      */
116     public java.lang.String getStandardURL()
117     {
118         return this._standardURL;
119     } //-- java.lang.String getStandardURL() 
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     } //-- boolean isValid() 
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     } //-- void marshal(java.io.Writer) 
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     } //-- void marshal(org.xml.sax.ContentHandler) 
158 
159     /***
160      * Sets the value of field 'standardID'.
161      * 
162      * @param standardID the value of field 'standardID'.
163      */
164     public void setStandardID(java.lang.String standardID)
165     {
166         this._standardID = standardID;
167     } //-- void setStandardID(java.lang.String) 
168 
169     /***
170      * Sets the value of field 'standardURL'.
171      * 
172      * @param standardURL the value of field 'standardURL'.
173      */
174     public void setStandardURL(java.lang.String standardURL)
175     {
176         this._standardURL = standardURL;
177     } //-- void setStandardURL(java.lang.String) 
178 
179     /***
180      * Method unmarshalSIACapRestriction
181      * 
182      * @param reader
183      */
184     public static org.astrogrid.registry.beans.v10.resource.sia.SIACapRestriction unmarshalSIACapRestriction(java.io.Reader reader)
185         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
186     {
187         return (org.astrogrid.registry.beans.v10.resource.sia.SIACapRestriction) Unmarshaller.unmarshal(org.astrogrid.registry.beans.v10.resource.sia.SIACapRestriction.class, reader);
188     } //-- org.astrogrid.registry.beans.v10.resource.sia.SIACapRestriction unmarshalSIACapRestriction(java.io.Reader) 
189 
190     /***
191      * Method validate
192      */
193     public void validate()
194         throws org.exolab.castor.xml.ValidationException
195     {
196         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
197         validator.validate(this);
198     } //-- void validate() 
199 
200 }