View Javadoc

1   /***
2    * @(#)ConfigurationDescriptor.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  package org.huihoo.jfox.soaf.schema.config;
25  
26  /***
27   * Class ConfigurationDescriptor.
28   * 
29   * @version $Revision: 1.8 $ $Date: 2005/05/22 06:47:43 $
30   * @version Revision: 1.0
31   */
32  
33  public class ConfigurationDescriptor 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 ConfigurationDescriptor() {
57          super();
58          xmlName = "configuration";
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          //-- _serviceConfiguration
70          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
71                  org.huihoo.jfox.soaf.schema.config.ServiceConfiguration.class,
72                  "_serviceConfiguration", "service-configuration",
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                  Configuration target = (Configuration) object;
78                  return target.getServiceConfiguration();
79              }
80  
81              public void setValue(java.lang.Object object, java.lang.Object value)
82                      throws IllegalStateException, IllegalArgumentException {
83                  try {
84                      Configuration target = (Configuration) object;
85                      target
86                              .setServiceConfiguration((org.huihoo.jfox.soaf.schema.config.ServiceConfiguration) 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.ServiceConfiguration();
94              }
95          });
96          desc.setHandler(handler);
97          desc.setRequired(true);
98          desc.setMultivalued(false);
99          addFieldDescriptor(desc);
100 
101         //-- validation code for: _serviceConfiguration
102         fieldValidator = new org.exolab.castor.xml.FieldValidator();
103         fieldValidator.setMinOccurs(1);
104         { //-- local scope
105         }
106         desc.setValidator(fieldValidator);
107         //-- _systemInterceptor
108         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
109                 org.huihoo.jfox.soaf.schema.config.SystemInterceptor.class,
110                 "_systemInterceptor", "system-interceptor",
111                 org.exolab.castor.xml.NodeType.Element);
112         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
113             public java.lang.Object getValue(java.lang.Object object)
114                     throws IllegalStateException {
115                 Configuration target = (Configuration) object;
116                 return target.getSystemInterceptor();
117             }
118 
119             public void setValue(java.lang.Object object, java.lang.Object value)
120                     throws IllegalStateException, IllegalArgumentException {
121                 try {
122                     Configuration target = (Configuration) object;
123                     target
124                             .setSystemInterceptor((org.huihoo.jfox.soaf.schema.config.SystemInterceptor) value);
125                 } catch (java.lang.Exception ex) {
126                     throw new IllegalStateException(ex.toString());
127                 }
128             }
129 
130             public java.lang.Object newInstance(java.lang.Object parent) {
131                 return new org.huihoo.jfox.soaf.schema.config.SystemInterceptor();
132             }
133         });
134         desc.setHandler(handler);
135         desc.setRequired(true);
136         desc.setMultivalued(false);
137         addFieldDescriptor(desc);
138 
139         //-- validation code for: _systemInterceptor
140         fieldValidator = new org.exolab.castor.xml.FieldValidator();
141         fieldValidator.setMinOccurs(1);
142         { //-- local scope
143         }
144         desc.setValidator(fieldValidator);
145     }
146 
147     /***
148      * Method getAccessMode
149      */
150     public org.exolab.castor.mapping.AccessMode getAccessMode() {
151         return null;
152     }
153 
154     /***
155      * Method getExtends
156      */
157     public org.exolab.castor.mapping.ClassDescriptor getExtends() {
158         return null;
159     }
160 
161     /***
162      * Method getIdentity
163      */
164     public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
165         return identity;
166     }
167 
168     /***
169      * Method getJavaClass
170      */
171     public java.lang.Class getJavaClass() {
172         return org.huihoo.jfox.soaf.schema.config.Configuration.class;
173     }
174 
175     /***
176      * Method getNameSpacePrefix
177      */
178     public java.lang.String getNameSpacePrefix() {
179         return nsPrefix;
180     }
181 
182     /***
183      * Method getNameSpaceURI
184      */
185     public java.lang.String getNameSpaceURI() {
186         return nsURI;
187     }
188 
189     /***
190      * Method getValidator
191      */
192     public org.exolab.castor.xml.TypeValidator getValidator() {
193         return this;
194     }
195 
196     /***
197      * Method getXMLName
198      */
199     public java.lang.String getXMLName() {
200         return xmlName;
201     }
202 
203 }