View Javadoc

1   /***
2    * JFoxSOAF, Service-Oriented Application Framework
3    * 
4    * Copyright (C) www.huihoo.org
5    * 
6    * Distributable under GNU LGPL For more information, please visit:
7    * http://www.huihoo.org/jfox/jfoxsoaf
8    */
9   
10  package org.huihoo.jfox.soaf.schema.config;
11  
12  import org.exolab.castor.xml.Marshaller;
13  import org.exolab.castor.xml.Unmarshaller;
14  
15  /***
16   * Class ConfigurationEntry.
17   * 
18   * @version $Revision: 1.4 $ $Date: 2004/10/13 10:50:36 $
19   */
20  
21  public class ConfigurationEntry implements java.io.Serializable {
22  
23      //--------------------------/
24      //- Class/Member Variables -/
25      //--------------------------/
26  
27      /***
28       * Field _name
29       */
30      private java.lang.String _name;
31  
32      /***
33       * Field _value
34       */
35      private java.lang.String _value;
36  
37      //----------------/
38      //- Constructors -/
39      //----------------/
40  
41      public ConfigurationEntry() {
42          super();
43      } //-- org.huihoo.jfox.soaf.schema.config.ConfigurationEntry()
44  
45      //-----------/
46      //- Methods -/
47      //-----------/
48  
49      /***
50       * Method getNameReturns the value of field 'name'.
51       * 
52       * @return the value of field 'name'.
53       */
54      public java.lang.String getName() {
55          return this._name;
56      } //-- java.lang.String getName()
57  
58      /***
59       * Method getValueReturns the value of field 'value'.
60       * 
61       * @return the value of field 'value'.
62       */
63      public java.lang.String getValue() {
64          return this._value;
65      } //-- java.lang.String getValue()
66  
67      /***
68       * Method isValid
69       */
70      public boolean isValid() {
71          try {
72              validate();
73          } catch (org.exolab.castor.xml.ValidationException vex) {
74              return false;
75          }
76          return true;
77      } //-- boolean isValid()
78  
79      /***
80       * Method marshal
81       * 
82       * @param out
83       */
84      public void marshal(java.io.Writer out)
85              throws org.exolab.castor.xml.MarshalException,
86              org.exolab.castor.xml.ValidationException {
87  
88          Marshaller.marshal(this, out);
89      } //-- void marshal(java.io.Writer)
90  
91      /***
92       * Method marshal
93       * 
94       * @param handler
95       */
96      public void marshal(org.xml.sax.ContentHandler handler)
97              throws java.io.IOException, org.exolab.castor.xml.MarshalException,
98              org.exolab.castor.xml.ValidationException {
99  
100         Marshaller.marshal(this, handler);
101     } //-- void marshal(org.xml.sax.ContentHandler)
102 
103     /***
104      * Method setNameSets the value of field 'name'.
105      * 
106      * @param name
107      *            the value of field 'name'.
108      */
109     public void setName(java.lang.String name) {
110         this._name = name;
111     } //-- void setName(java.lang.String)
112 
113     /***
114      * Method setValueSets the value of field 'value'.
115      * 
116      * @param value
117      *            the value of field 'value'.
118      */
119     public void setValue(java.lang.String value) {
120         this._value = value;
121     } //-- void setValue(java.lang.String)
122 
123     /***
124      * Method unmarshal
125      * 
126      * @param reader
127      */
128     public static org.huihoo.jfox.soaf.schema.config.ConfigurationEntry unmarshal(
129             java.io.Reader reader)
130             throws org.exolab.castor.xml.MarshalException,
131             org.exolab.castor.xml.ValidationException {
132         return (org.huihoo.jfox.soaf.schema.config.ConfigurationEntry) Unmarshaller
133                 .unmarshal(
134                         org.huihoo.jfox.soaf.schema.config.ConfigurationEntry.class,
135                         reader);
136     } //-- org.huihoo.jfox.soaf.schema.config.ConfigurationEntry
137       // unmarshal(java.io.Reader)
138 
139     /***
140      * Method validate
141      */
142     public void validate() throws org.exolab.castor.xml.ValidationException {
143         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
144         validator.validate(this);
145     } //-- void validate()
146 
147 }