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