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.config;
    11
    12  import org.exolab.castor.xml.validators.StringValidator;
    13
    14  /***
    15   * Class ConfigurationEntryDescriptor.
    16   *
    17   * @version $Revision: 1.3 $ $Date: 2004/10/13 10:50:55 $
    18   */
    19
    20  public class ConfigurationEntryDescriptor 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 ConfigurationEntryDescriptor() {
    44          super();
    45          xmlName = "configuration-entry";
    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          //-- _name
    57          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
    58                  java.lang.String.class, "_name", "name",
    59                  org.exolab.castor.xml.NodeType.Element);
    60          desc.setImmutable(true);
    61          handler = (new org.exolab.castor.xml.XMLFieldHandler() {
    62              public java.lang.Object getValue(java.lang.Object object)
    63                      throws IllegalStateException {
    64                  ConfigurationEntry target = (ConfigurationEntry) object;
    65                  return target.getName();
    66              }
    67
    68              public void setValue(java.lang.Object object, java.lang.Object value)
    69                      throws IllegalStateException, IllegalArgumentException {
    70                  try {
    71                      ConfigurationEntry target = (ConfigurationEntry) object;
    72                      target.setName((java.lang.String) value);
    73                  } catch (java.lang.Exception ex) {
    74                      throw new IllegalStateException(ex.toString());
    75                  }
    76              }
    77
    78              public java.lang.Object newInstance(java.lang.Object parent) {
    79                  return null;
    80              }
    81          });
    82          desc.setHandler(handler);
    83          desc.setRequired(true);
    84          desc.setMultivalued(false);
    85          addFieldDescriptor(desc);
    86
    87          //-- validation code for: _name
    88          fieldValidator = new org.exolab.castor.xml.FieldValidator();
    89          fieldValidator.setMinOccurs(1);
    90          { //-- local scope
    91              StringValidator typeValidator = new StringValidator();
    92              typeValidator.setWhiteSpace("preserve");
    93              fieldValidator.setValidator(typeValidator);
    94          }
    95          desc.setValidator(fieldValidator);
    96          //-- _value
    97          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
    98                  java.lang.String.class, "_value", "value",
    99                  org.exolab.castor.xml.NodeType.Element);
    100         desc.setImmutable(true);
    101         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
    102             public java.lang.Object getValue(java.lang.Object object)
    103                     throws IllegalStateException {
    104                 ConfigurationEntry target = (ConfigurationEntry) object;
    105                 return target.getValue();
    106             }
    107
    108             public void setValue(java.lang.Object object, java.lang.Object value)
    109                     throws IllegalStateException, IllegalArgumentException {
    110                 try {
    111                     ConfigurationEntry target = (ConfigurationEntry) object;
    112                     target.setValue((java.lang.String) value);
    113                 } catch (java.lang.Exception ex) {
    114                     throw new IllegalStateException(ex.toString());
    115                 }
    116             }
    117
    118             public java.lang.Object newInstance(java.lang.Object parent) {
    119                 return null;
    120             }
    121         });
    122         desc.setHandler(handler);
    123         desc.setRequired(true);
    124         desc.setMultivalued(false);
    125         addFieldDescriptor(desc);
    126
    127         //-- validation code for: _value
    128         fieldValidator = new org.exolab.castor.xml.FieldValidator();
    129         fieldValidator.setMinOccurs(1);
    130         { //-- local scope
    131             StringValidator typeValidator = new StringValidator();
    132             typeValidator.setWhiteSpace("preserve");
    133             fieldValidator.setValidator(typeValidator);
    134         }
    135         desc.setValidator(fieldValidator);
    136     }
    137
    138     /***
    139      * Method getAccessMode
    140      */
    141     public org.exolab.castor.mapping.AccessMode getAccessMode() {
    142         return null;
    143     }
    144
    145     /***
    146      * Method getExtends
    147      */
    148     public org.exolab.castor.mapping.ClassDescriptor getExtends() {
    149         return null;
    150     }
    151
    152     /***
    153      * Method getIdentity
    154      */
    155     public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
    156         return identity;
    157     }
    158
    159     /***
    160      * Method getJavaClass
    161      */
    162     public java.lang.Class getJavaClass() {
    163         return org.huihoo.jfox.soaf.schema.config.ConfigurationEntry.class;
    164     }
    165
    166     /***
    167      * Method getNameSpacePrefix
    168      */
    169     public java.lang.String getNameSpacePrefix() {
    170         return nsPrefix;
    171     }
    172
    173     /***
    174      * Method getNameSpaceURI
    175      */
    176     public java.lang.String getNameSpaceURI() {
    177         return nsURI;
    178     }
    179
    180     /***
    181      * Method getValidator
    182      */
    183     public org.exolab.castor.xml.TypeValidator getValidator() {
    184         return this;
    185     }
    186
    187     /***
    188      * Method getXMLName
    189      */
    190     public java.lang.String getXMLName() {
    191         return xmlName;
    192     }
    193
    194 }