View Javadoc

1   /***
2    * @(#)Parameter.java
3    * 
4    * JFoxSOAF, Service-Oriented Application Framework
5    * 
6    * Copyright(c) JFoxSOAF Team
7    * 
8    * Licensed under the GNU LGPL, Version 2.1 (the "License"); 
9    * you may not use this file except in compliance with the License. 
10   * You may obtain a copy of the License at  
11   * 
12   * http://www.gnu.org/copyleft/lesser.html
13   * 
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS, 
16   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
17   * See the License for the specific language governing permissions and 
18   * limitations under the License. 
19   * 
20   * For more information, please visit:
21   * http://www.jfox.cn/confluence/display/JFoxSOAF/Home
22   * http://www.huihoo.org/jfox/jfoxsoaf
23   */
24  
25  package org.huihoo.jfox.soaf.schema.service;
26  
27  import org.exolab.castor.xml.Marshaller;
28  import org.exolab.castor.xml.Unmarshaller;
29  
30  /***
31   * <p>
32   * Class Parameter.
33   * </p>
34   * 
35   * @author <a href="mailto:founder_chen@yahoo.com.cn">Peter Cheng </a>
36   * @version $Revision: 1.7 $ $Date: 2005/05/22 06:48:07 $
37   * @version Revision: 1.0
38   */
39  
40  public class Parameter implements java.io.Serializable {
41  
42      /***
43       * Field _name
44       */
45      private java.lang.String _name;
46  
47      /***
48       * Field _value
49       */
50      private java.lang.String _value;
51  
52      public Parameter() {
53          super();
54      }
55  
56      /***
57       * Method getNameReturns the value of field 'name'.
58       * 
59       * @return the value of field 'name'.
60       */
61      public java.lang.String getName() {
62          return this._name;
63      }
64  
65      /***
66       * Method getValueReturns the value of field 'value'.
67       * 
68       * @return the value of field 'value'.
69       */
70      public java.lang.String getValue() {
71          return this._value;
72      }
73  
74      /***
75       * Method isValid
76       */
77      public boolean isValid() {
78          try {
79              validate();
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,
93              org.exolab.castor.xml.ValidationException {
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,
105             org.exolab.castor.xml.ValidationException {
106 
107         Marshaller.marshal(this, handler);
108     }
109 
110     /***
111      * Method setNameSets the value of field 'name'.
112      * 
113      * @param name the value of field 'name'.
114      */
115     public void setName(java.lang.String name) {
116         this._name = name;
117     }
118 
119     /***
120      * Method setValueSets the value of field 'value'.
121      * 
122      * @param value the value of field 'value'.
123      */
124     public void setValue(java.lang.String value) {
125         this._value = value;
126     }
127 
128     /***
129      * Method unmarshal
130      * 
131      * @param reader
132      */
133     public static org.huihoo.jfox.soaf.schema.service.Parameter unmarshal(
134             java.io.Reader reader)
135             throws org.exolab.castor.xml.MarshalException,
136             org.exolab.castor.xml.ValidationException {
137         return (org.huihoo.jfox.soaf.schema.service.Parameter) Unmarshaller
138                 .unmarshal(org.huihoo.jfox.soaf.schema.service.Parameter.class,
139                         reader);
140     }
141 
142     /***
143      * Method validate
144      */
145     public void validate() throws org.exolab.castor.xml.ValidationException {
146         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
147         validator.validate(this);
148     }
149 
150 }