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  import org.exolab.castor.xml.validators.StringValidator;
    13
    14  /***
    15   * <p>
    16   * Class ServiceEntryDescriptor.
    17   * </p>
    18   *
    19   * @author <a href="mailto:founder_chen@yahoo.com.cn">Peter Cheng </a>
    20   * @version $Revision: 1.4 $ $Date: 2004/10/18 11:47:02 $
    21   * @version Revision: 1.0
    22   */
    23
    24  public class ServiceEntryDescriptor extends
    25          org.exolab.castor.xml.util.XMLClassDescriptorImpl {
    26
    27      /***
    28       * Field nsPrefix
    29       */
    30      private java.lang.String nsPrefix;
    31
    32      /***
    33       * Field nsURI
    34       */
    35      private java.lang.String nsURI;
    36
    37      /***
    38       * Field xmlName
    39       */
    40      private java.lang.String xmlName;
    41
    42      /***
    43       * Field identity
    44       */
    45      private org.exolab.castor.xml.XMLFieldDescriptor identity;
    46
    47      public ServiceEntryDescriptor() {
    48          super();
    49          xmlName = "service-entry";
    50
    51          //-- set grouping compositor
    52          setCompositorAsSequence();
    53          org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    54          org.exolab.castor.xml.XMLFieldHandler handler = null;
    55          org.exolab.castor.xml.FieldValidator fieldValidator = null;
    56          //-- initialize attribute descriptors
    57
    58          //-- initialize element descriptors
    59
    60          //-- _id
    61          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
    62                  java.lang.String.class, "_id", "id",
    63                  org.exolab.castor.xml.NodeType.Element);
    64          desc.setImmutable(true);
    65          handler = (new org.exolab.castor.xml.XMLFieldHandler() {
    66              public java.lang.Object getValue(java.lang.Object object)
    67                      throws IllegalStateException {
    68                  ServiceEntry target = (ServiceEntry) object;
    69                  return target.getId();
    70              }
    71
    72              public void setValue(java.lang.Object object, java.lang.Object value)
    73                      throws IllegalStateException, IllegalArgumentException {
    74                  try {
    75                      ServiceEntry target = (ServiceEntry) object;
    76                      target.setId((java.lang.String) value);
    77                  } catch (java.lang.Exception ex) {
    78                      throw new IllegalStateException(ex.toString());
    79                  }
    80              }
    81
    82              public java.lang.Object newInstance(java.lang.Object parent) {
    83                  return null;
    84              }
    85          });
    86          desc.setHandler(handler);
    87          desc.setMultivalued(false);
    88          addFieldDescriptor(desc);
    89
    90          //-- validation code for: _id
    91          fieldValidator = new org.exolab.castor.xml.FieldValidator();
    92          { //-- local scope
    93              StringValidator typeValidator = new StringValidator();
    94              typeValidator.setWhiteSpace("preserve");
    95              fieldValidator.setValidator(typeValidator);
    96          }
    97          desc.setValidator(fieldValidator);
    98          //-- _description
    99          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
    100                 java.lang.String.class, "_description", "description",
    101                 org.exolab.castor.xml.NodeType.Element);
    102         desc.setImmutable(true);
    103         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
    104             public java.lang.Object getValue(java.lang.Object object)
    105                     throws IllegalStateException {
    106                 ServiceEntry target = (ServiceEntry) object;
    107                 return target.getDescription();
    108             }
    109
    110             public void setValue(java.lang.Object object, java.lang.Object value)
    111                     throws IllegalStateException, IllegalArgumentException {
    112                 try {
    113                     ServiceEntry target = (ServiceEntry) object;
    114                     target.setDescription((java.lang.String) value);
    115                 } catch (java.lang.Exception ex) {
    116                     throw new IllegalStateException(ex.toString());
    117                 }
    118             }
    119
    120             public java.lang.Object newInstance(java.lang.Object parent) {
    121                 return null;
    122             }
    123         });
    124         desc.setHandler(handler);
    125         desc.setMultivalued(false);
    126         addFieldDescriptor(desc);
    127
    128         //-- validation code for: _description
    129         fieldValidator = new org.exolab.castor.xml.FieldValidator();
    130         { //-- local scope
    131             StringValidator typeValidator = new StringValidator();
    132             typeValidator.setWhiteSpace("preserve");
    133             fieldValidator.setValidator(typeValidator);
    134         }
    135         desc.setValidator(fieldValidator);
    136         //-- _manageable
    137         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
    138                 java.lang.String.class, "_manageable", "manageable",
    139                 org.exolab.castor.xml.NodeType.Element);
    140         desc.setImmutable(true);
    141         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
    142             public java.lang.Object getValue(java.lang.Object object)
    143                     throws IllegalStateException {
    144                 ServiceEntry target = (ServiceEntry) object;
    145                 return target.getManageable();
    146             }
    147
    148             public void setValue(java.lang.Object object, java.lang.Object value)
    149                     throws IllegalStateException, IllegalArgumentException {
    150                 try {
    151                     ServiceEntry target = (ServiceEntry) object;
    152                     target.setManageable((java.lang.String) value);
    153                 } catch (java.lang.Exception ex) {
    154                     throw new IllegalStateException(ex.toString());
    155                 }
    156             }
    157
    158             public java.lang.Object newInstance(java.lang.Object parent) {
    159                 return null;
    160             }
    161         });
    162         desc.setHandler(handler);
    163         desc.setRequired(true);
    164         desc.setMultivalued(false);
    165         addFieldDescriptor(desc);
    166
    167         //-- validation code for: _manageable
    168         fieldValidator = new org.exolab.castor.xml.FieldValidator();
    169         fieldValidator.setMinOccurs(1);
    170         { //-- local scope
    171             StringValidator typeValidator = new StringValidator();
    172             typeValidator.setWhiteSpace("preserve");
    173             fieldValidator.setValidator(typeValidator);
    174         }
    175         desc.setValidator(fieldValidator);
    176         //-- _interface
    177         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
    178                 java.lang.String.class, "_interface", "interface",
    179                 org.exolab.castor.xml.NodeType.Element);
    180         desc.setImmutable(true);
    181         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
    182             public java.lang.Object getValue(java.lang.Object object)
    183                     throws IllegalStateException {
    184                 ServiceEntry target = (ServiceEntry) object;
    185                 return target.getInterface();
    186             }
    187
    188             public void setValue(java.lang.Object object, java.lang.Object value)
    189                     throws IllegalStateException, IllegalArgumentException {
    190                 try {
    191                     ServiceEntry target = (ServiceEntry) object;
    192                     target.setInterface((java.lang.String) value);
    193                 } catch (java.lang.Exception ex) {
    194                     throw new IllegalStateException(ex.toString());
    195                 }
    196             }
    197
    198             public java.lang.Object newInstance(java.lang.Object parent) {
    199                 return null;
    200             }
    201         });
    202         desc.setHandler(handler);
    203         desc.setMultivalued(false);
    204         addFieldDescriptor(desc);
    205
    206         //-- validation code for: _interface
    207         fieldValidator = new org.exolab.castor.xml.FieldValidator();
    208         { //-- local scope
    209             StringValidator typeValidator = new StringValidator();
    210             typeValidator.setWhiteSpace("preserve");
    211             fieldValidator.setValidator(typeValidator);
    212         }
    213         desc.setValidator(fieldValidator);
    214         //-- _implementation
    215         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
    216                 java.lang.String.class, "_implementation", "implementation",
    217                 org.exolab.castor.xml.NodeType.Element);
    218         desc.setImmutable(true);
    219         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
    220             public java.lang.Object getValue(java.lang.Object object)
    221                     throws IllegalStateException {
    222                 ServiceEntry target = (ServiceEntry) object;
    223                 return target.getImplementation();
    224             }
    225
    226             public void setValue(java.lang.Object object, java.lang.Object value)
    227                     throws IllegalStateException, IllegalArgumentException {
    228                 try {
    229                     ServiceEntry target = (ServiceEntry) object;
    230                     target.setImplementation((java.lang.String) value);
    231                 } catch (java.lang.Exception ex) {
    232                     throw new IllegalStateException(ex.toString());
    233                 }
    234             }
    235
    236             public java.lang.Object newInstance(java.lang.Object parent) {
    237                 return null;
    238             }
    239         });
    240         desc.setHandler(handler);
    241         desc.setRequired(true);
    242         desc.setMultivalued(false);
    243         addFieldDescriptor(desc);
    244
    245         //-- validation code for: _implementation
    246         fieldValidator = new org.exolab.castor.xml.FieldValidator();
    247         fieldValidator.setMinOccurs(1);
    248         { //-- local scope
    249             StringValidator typeValidator = new StringValidator();
    250             typeValidator.setWhiteSpace("preserve");
    251             fieldValidator.setValidator(typeValidator);
    252         }
    253         desc.setValidator(fieldValidator);
    254         //-- _parameterList
    255         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
    256                 org.huihoo.jfox.soaf.schema.service.Parameter.class,
    257                 "_parameterList", "parameter",
    258                 org.exolab.castor.xml.NodeType.Element);
    259         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
    260             public java.lang.Object getValue(java.lang.Object object)
    261                     throws IllegalStateException {
    262                 ServiceEntry target = (ServiceEntry) object;
    263                 return target.getParameter();
    264             }
    265
    266             public void setValue(java.lang.Object object, java.lang.Object value)
    267                     throws IllegalStateException, IllegalArgumentException {
    268                 try {
    269                     ServiceEntry target = (ServiceEntry) object;
    270                     target
    271                             .addParameter((org.huihoo.jfox.soaf.schema.service.Parameter) value);
    272                 } catch (java.lang.Exception ex) {
    273                     throw new IllegalStateException(ex.toString());
    274                 }
    275             }
    276
    277             public java.lang.Object newInstance(java.lang.Object parent) {
    278                 return new org.huihoo.jfox.soaf.schema.service.Parameter();
    279             }
    280         });
    281         desc.setHandler(handler);
    282         desc.setMultivalued(true);
    283         addFieldDescriptor(desc);
    284
    285         //-- validation code for: _parameterList
    286         fieldValidator = new org.exolab.castor.xml.FieldValidator();
    287         fieldValidator.setMinOccurs(0);
    288         { //-- local scope
    289         }
    290         desc.setValidator(fieldValidator);
    291     }
    292
    293     /***
    294      * Method getAccessMode
    295      */
    296     public org.exolab.castor.mapping.AccessMode getAccessMode() {
    297         return null;
    298     }
    299
    300     /***
    301      * Method getExtends
    302      */
    303     public org.exolab.castor.mapping.ClassDescriptor getExtends() {
    304         return null;
    305     }
    306
    307     /***
    308      * Method getIdentity
    309      */
    310     public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
    311         return identity;
    312     }
    313
    314     /***
    315      * Method getJavaClass
    316      */
    317     public java.lang.Class getJavaClass() {
    318         return org.huihoo.jfox.soaf.schema.service.ServiceEntry.class;
    319     }
    320
    321     /***
    322      * Method getNameSpacePrefix
    323      */
    324     public java.lang.String getNameSpacePrefix() {
    325         return nsPrefix;
    326     }
    327
    328     /***
    329      * Method getNameSpaceURI
    330      */
    331     public java.lang.String getNameSpaceURI() {
    332         return nsURI;
    333     }
    334
    335     /***
    336      * Method getValidator
    337      */
    338     public org.exolab.castor.xml.TypeValidator getValidator() {
    339         return this;
    340     }
    341
    342     /***
    343      * Method getXMLName
    344      */
    345     public java.lang.String getXMLName() {
    346         return xmlName;
    347     }
    348
    349 }