View Javadoc

1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 0.9.7</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8   package fr.in2p3.jsaga.adaptor.schema.data.emulator;
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   * Class ServerType.
26   * 
27   * @version $Revision$ $Date$
28   */
29  public class ServerType extends fr.in2p3.jsaga.adaptor.schema.data.emulator.DirectoryType 
30  implements java.io.Serializable
31  {
32  
33  
34        //--------------------------/
35       //- Class/Member Variables -/
36      //--------------------------/
37  
38      /**
39       * Field _protocol
40       */
41      private java.lang.String _protocol;
42  
43      /**
44       * Field _host
45       */
46      private java.lang.String _host;
47  
48      /**
49       * Field _port
50       */
51      private int _port;
52  
53      /**
54       * keeps track of state for field: _port
55       */
56      private boolean _has_port;
57  
58  
59        //----------------/
60       //- Constructors -/
61      //----------------/
62  
63      public ServerType() 
64       {
65          super();
66      } //-- fr.in2p3.jsaga.adaptor.schema.data.emulator.ServerType()
67  
68  
69        //-----------/
70       //- Methods -/
71      //-----------/
72  
73      /**
74       * Method deletePort
75       * 
76       */
77      public void deletePort()
78      {
79          this._has_port= false;
80      } //-- void deletePort() 
81  
82      /**
83       * Returns the value of field 'host'.
84       * 
85       * @return String
86       * @return the value of field 'host'.
87       */
88      public java.lang.String getHost()
89      {
90          return this._host;
91      } //-- java.lang.String getHost() 
92  
93      /**
94       * Returns the value of field 'port'.
95       * 
96       * @return int
97       * @return the value of field 'port'.
98       */
99      public int getPort()
100     {
101         return this._port;
102     } //-- int getPort() 
103 
104     /**
105      * Returns the value of field 'protocol'.
106      * 
107      * @return String
108      * @return the value of field 'protocol'.
109      */
110     public java.lang.String getProtocol()
111     {
112         return this._protocol;
113     } //-- java.lang.String getProtocol() 
114 
115     /**
116      * Method hasPort
117      * 
118      * 
119      * 
120      * @return boolean
121      */
122     public boolean hasPort()
123     {
124         return this._has_port;
125     } //-- boolean hasPort() 
126 
127     /**
128      * Method isValid
129      * 
130      * 
131      * 
132      * @return boolean
133      */
134     public boolean isValid()
135     {
136         try {
137             validate();
138         }
139         catch (org.exolab.castor.xml.ValidationException vex) {
140             return false;
141         }
142         return true;
143     } //-- boolean isValid() 
144 
145     /**
146      * Method marshal
147      * 
148      * 
149      * 
150      * @param out
151      */
152     public void marshal(java.io.Writer out)
153         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
154     {
155         
156         Marshaller.marshal(this, out);
157     } //-- void marshal(java.io.Writer) 
158 
159     /**
160      * Method marshal
161      * 
162      * 
163      * 
164      * @param handler
165      */
166     public void marshal(org.xml.sax.ContentHandler handler)
167         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
168     {
169         
170         Marshaller.marshal(this, handler);
171     } //-- void marshal(org.xml.sax.ContentHandler) 
172 
173     /**
174      * Sets the value of field 'host'.
175      * 
176      * @param host the value of field 'host'.
177      */
178     public void setHost(java.lang.String host)
179     {
180         this._host = host;
181     } //-- void setHost(java.lang.String) 
182 
183     /**
184      * Sets the value of field 'port'.
185      * 
186      * @param port the value of field 'port'.
187      */
188     public void setPort(int port)
189     {
190         this._port = port;
191         this._has_port = true;
192     } //-- void setPort(int) 
193 
194     /**
195      * Sets the value of field 'protocol'.
196      * 
197      * @param protocol the value of field 'protocol'.
198      */
199     public void setProtocol(java.lang.String protocol)
200     {
201         this._protocol = protocol;
202     } //-- void setProtocol(java.lang.String) 
203 
204     /**
205      * Method unmarshal
206      * 
207      * 
208      * 
209      * @param reader
210      * @return Object
211      */
212     public static java.lang.Object unmarshal(java.io.Reader reader)
213         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
214     {
215         return (fr.in2p3.jsaga.adaptor.schema.data.emulator.ServerType) Unmarshaller.unmarshal(fr.in2p3.jsaga.adaptor.schema.data.emulator.ServerType.class, reader);
216     } //-- java.lang.Object unmarshal(java.io.Reader) 
217 
218     /**
219      * Method validate
220      * 
221      */
222     public void validate()
223         throws org.exolab.castor.xml.ValidationException
224     {
225         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
226         validator.validate(this);
227     } //-- void validate() 
228 
229 }