View Javadoc

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