View Javadoc

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