View Javadoc

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