View Javadoc

1   /***
2    * @(#)SystemInterceptorDescriptor.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  /***
28   * Class SystemInterceptorDescriptor.
29   * 
30   * @version $Revision: 1.5 $ $Date: 2005/05/22 06:47:43 $
31   */
32  
33  public class SystemInterceptorDescriptor extends
34          org.exolab.castor.xml.util.XMLClassDescriptorImpl {
35  
36      /***
37       * Field nsPrefix
38       */
39      private java.lang.String nsPrefix;
40  
41      /***
42       * Field nsURI
43       */
44      private java.lang.String nsURI;
45  
46      /***
47       * Field xmlName
48       */
49      private java.lang.String xmlName;
50  
51      /***
52       * Field identity
53       */
54      private org.exolab.castor.xml.XMLFieldDescriptor identity;
55  
56      public SystemInterceptorDescriptor() {
57          super();
58          xmlName = "system-interceptor";
59  
60          //-- set grouping compositor
61          setCompositorAsSequence();
62          org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
63          org.exolab.castor.xml.XMLFieldHandler handler = null;
64          org.exolab.castor.xml.FieldValidator fieldValidator = null;
65          //-- initialize attribute descriptors
66  
67          //-- initialize element descriptors
68  
69          //-- _interceptorList
70          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
71                  org.huihoo.jfox.soaf.schema.config.Interceptor.class,
72                  "_interceptorList", "interceptor",
73                  org.exolab.castor.xml.NodeType.Element);
74          handler = (new org.exolab.castor.xml.XMLFieldHandler() {
75              public java.lang.Object getValue(java.lang.Object object)
76                      throws IllegalStateException {
77                  SystemInterceptor target = (SystemInterceptor) object;
78                  return target.getInterceptor();
79              }
80  
81              public void setValue(java.lang.Object object, java.lang.Object value)
82                      throws IllegalStateException, IllegalArgumentException {
83                  try {
84                      SystemInterceptor target = (SystemInterceptor) object;
85                      target
86                              .addInterceptor((org.huihoo.jfox.soaf.schema.config.Interceptor) value);
87                  } catch (java.lang.Exception ex) {
88                      throw new IllegalStateException(ex.toString());
89                  }
90              }
91  
92              public java.lang.Object newInstance(java.lang.Object parent) {
93                  return new org.huihoo.jfox.soaf.schema.config.Interceptor();
94              }
95          });
96          desc.setHandler(handler);
97          desc.setMultivalued(true);
98          addFieldDescriptor(desc);
99  
100         //-- validation code for: _interceptorList
101         fieldValidator = new org.exolab.castor.xml.FieldValidator();
102         fieldValidator.setMinOccurs(0);
103         { //-- local scope
104         }
105         desc.setValidator(fieldValidator);
106     }
107 
108     /***
109      * Method getAccessMode
110      */
111     public org.exolab.castor.mapping.AccessMode getAccessMode() {
112         return null;
113     }
114 
115     /***
116      * Method getExtends
117      */
118     public org.exolab.castor.mapping.ClassDescriptor getExtends() {
119         return null;
120     }
121 
122     /***
123      * Method getIdentity
124      */
125     public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
126         return identity;
127     }
128 
129     /***
130      * Method getJavaClass
131      */
132     public java.lang.Class getJavaClass() {
133         return org.huihoo.jfox.soaf.schema.config.SystemInterceptor.class;
134     }
135 
136     /***
137      * Method getNameSpacePrefix
138      */
139     public java.lang.String getNameSpacePrefix() {
140         return nsPrefix;
141     }
142 
143     /***
144      * Method getNameSpaceURI
145      */
146     public java.lang.String getNameSpaceURI() {
147         return nsURI;
148     }
149 
150     /***
151      * Method getValidator
152      */
153     public org.exolab.castor.xml.TypeValidator getValidator() {
154         return this;
155     }
156 
157     /***
158      * Method getXMLName
159      */
160     public java.lang.String getXMLName() {
161         return xmlName;
162     }
163 
164 }