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