View Javadoc

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