View Javadoc

1   /***
2    * @(#)ConfigurationEntry.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.config;
26  
27  import org.exolab.castor.xml.Marshaller;
28  import org.exolab.castor.xml.Unmarshaller;
29  
30  /***
31   * Class ConfigurationEntry.
32   * 
33   * @version $Revision: 1.8 $ $Date: 2005/05/22 06:47:43 $
34   */
35  
36  public class ConfigurationEntry implements java.io.Serializable {
37  
38      //--------------------------/
39      //- Class/Member Variables -/
40      //--------------------------/
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      //----------------/
53      //- Constructors -/
54      //----------------/
55  
56      public ConfigurationEntry() {
57          super();
58      } //-- org.huihoo.jfox.soaf.schema.config.ConfigurationEntry()
59  
60      //-----------/
61      //- Methods -/
62      //-----------/
63  
64      /***
65       * Method getNameReturns the value of field 'name'.
66       * 
67       * @return the value of field 'name'.
68       */
69      public java.lang.String getName() {
70          return this._name;
71      } //-- java.lang.String getName()
72  
73      /***
74       * Method getValueReturns the value of field 'value'.
75       * 
76       * @return the value of field 'value'.
77       */
78      public java.lang.String getValue() {
79          return this._value;
80      } //-- java.lang.String getValue()
81  
82      /***
83       * Method isValid
84       */
85      public boolean isValid() {
86          try {
87              validate();
88          } catch (org.exolab.castor.xml.ValidationException vex) {
89              return false;
90          }
91          return true;
92      } //-- boolean isValid()
93  
94      /***
95       * Method marshal
96       * 
97       * @param out
98       */
99      public void marshal(java.io.Writer out)
100             throws org.exolab.castor.xml.MarshalException,
101             org.exolab.castor.xml.ValidationException {
102 
103         Marshaller.marshal(this, out);
104     } //-- void marshal(java.io.Writer)
105 
106     /***
107      * Method marshal
108      * 
109      * @param handler
110      */
111     public void marshal(org.xml.sax.ContentHandler handler)
112             throws java.io.IOException, org.exolab.castor.xml.MarshalException,
113             org.exolab.castor.xml.ValidationException {
114 
115         Marshaller.marshal(this, handler);
116     } //-- void marshal(org.xml.sax.ContentHandler)
117 
118     /***
119      * Method setNameSets the value of field 'name'.
120      * 
121      * @param name the value of field 'name'.
122      */
123     public void setName(java.lang.String name) {
124         this._name = name;
125     } //-- void setName(java.lang.String)
126 
127     /***
128      * Method setValueSets the value of field 'value'.
129      * 
130      * @param value the value of field 'value'.
131      */
132     public void setValue(java.lang.String value) {
133         this._value = value;
134     } //-- void setValue(java.lang.String)
135 
136     /***
137      * Method unmarshal
138      * 
139      * @param reader
140      */
141     public static org.huihoo.jfox.soaf.schema.config.ConfigurationEntry unmarshal(
142             java.io.Reader reader)
143             throws org.exolab.castor.xml.MarshalException,
144             org.exolab.castor.xml.ValidationException {
145         return (org.huihoo.jfox.soaf.schema.config.ConfigurationEntry) Unmarshaller
146                 .unmarshal(
147                         org.huihoo.jfox.soaf.schema.config.ConfigurationEntry.class,
148                         reader);
149     } //-- org.huihoo.jfox.soaf.schema.config.ConfigurationEntry
150 
151     // unmarshal(java.io.Reader)
152 
153     /***
154      * Method validate
155      */
156     public void validate() throws org.exolab.castor.xml.ValidationException {
157         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
158         validator.validate(this);
159     } //-- void validate()
160 
161 }