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 ParameterDescriptor.
    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 10:17:08 $
    21   * @version Revision: 1.0
    22   */
    23
    24  public class ParameterDescriptor 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 ParameterDescriptor() {
    48          super();
    49          xmlName = "parameter";
    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          //-- _name
    61          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
    62                  java.lang.String.class, "_name", "name",
    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                  Parameter target = (Parameter) object;
    69                  return target.getName();
    70              }
    71
    72              public void setValue(java.lang.Object object, java.lang.Object value)
    73                      throws IllegalStateException, IllegalArgumentException {
    74                  try {
    75                      Parameter target = (Parameter) object;
    76                      target.setName((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.setRequired(true);
    88          desc.setMultivalued(false);
    89          addFieldDescriptor(desc);
    90
    91          //-- validation code for: _name
    92          fieldValidator = new org.exolab.castor.xml.FieldValidator();
    93          fieldValidator.setMinOccurs(1);
    94          { //-- local scope
    95              StringValidator typeValidator = new StringValidator();
    96              typeValidator.setWhiteSpace("preserve");
    97              fieldValidator.setValidator(typeValidator);
    98          }
    99          desc.setValidator(fieldValidator);
    100         //-- _value
    101         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
    102                 java.lang.String.class, "_value", "value",
    103                 org.exolab.castor.xml.NodeType.Element);
    104         desc.setImmutable(true);
    105         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
    106             public java.lang.Object getValue(java.lang.Object object)
    107                     throws IllegalStateException {
    108                 Parameter target = (Parameter) object;
    109                 return target.getValue();
    110             }
    111
    112             public void setValue(java.lang.Object object, java.lang.Object value)
    113                     throws IllegalStateException, IllegalArgumentException {
    114                 try {
    115                     Parameter target = (Parameter) object;
    116                     target.setValue((java.lang.String) value);
    117                 } catch (java.lang.Exception ex) {
    118                     throw new IllegalStateException(ex.toString());
    119                 }
    120             }
    121
    122             public java.lang.Object newInstance(java.lang.Object parent) {
    123                 return null;
    124             }
    125         });
    126         desc.setHandler(handler);
    127         desc.setRequired(true);
    128         desc.setMultivalued(false);
    129         addFieldDescriptor(desc);
    130
    131         //-- validation code for: _value
    132         fieldValidator = new org.exolab.castor.xml.FieldValidator();
    133         fieldValidator.setMinOccurs(1);
    134         { //-- local scope
    135             StringValidator typeValidator = new StringValidator();
    136             typeValidator.setWhiteSpace("preserve");
    137             fieldValidator.setValidator(typeValidator);
    138         }
    139         desc.setValidator(fieldValidator);
    140     }
    141
    142     /***
    143      * Method getAccessMode
    144      */
    145     public org.exolab.castor.mapping.AccessMode getAccessMode() {
    146         return null;
    147     }
    148
    149     /***
    150      * Method getExtends
    151      */
    152     public org.exolab.castor.mapping.ClassDescriptor getExtends() {
    153         return null;
    154     }
    155
    156     /***
    157      * Method getIdentity
    158      */
    159     public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
    160         return identity;
    161     }
    162
    163     /***
    164      * Method getJavaClass
    165      */
    166     public java.lang.Class getJavaClass() {
    167         return org.huihoo.jfox.soaf.schema.service.Parameter.class;
    168     }
    169
    170     /***
    171      * Method getNameSpacePrefix
    172      */
    173     public java.lang.String getNameSpacePrefix() {
    174         return nsPrefix;
    175     }
    176
    177     /***
    178      * Method getNameSpaceURI
    179      */
    180     public java.lang.String getNameSpaceURI() {
    181         return nsURI;
    182     }
    183
    184     /***
    185      * Method getValidator
    186      */
    187     public org.exolab.castor.xml.TypeValidator getValidator() {
    188         return this;
    189     }
    190
    191     /***
    192      * Method getXMLName
    193      */
    194     public java.lang.String getXMLName() {
    195         return xmlName;
    196     }
    197
    198 }