public SecurityRequirementDescriptor() {
    super();
    xmlName = "security-requirement";
    XMLFieldDescriptorImpl desc = null;
    XMLFieldHandler handler = null;
    FieldValidator fieldValidator = null;

    // -- set grouping compositor
    setCompositorAsSequence();
    // -- initialize attribute descriptors

    // -- initialize element descriptors

    // -- _description
    desc =
        new XMLFieldDescriptorImpl(
            java.lang.String.class, "_description", "description", NodeType.Element);
    desc.setImmutable(true);
    handler =
        (new XMLFieldHandler() {
          public Object getValue(Object object) throws IllegalStateException {
            SecurityRequirement target = (SecurityRequirement) object;
            return target.getDescription();
          }

          public void setValue(Object object, Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              SecurityRequirement target = (SecurityRequirement) object;
              target.setDescription((java.lang.String) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public Object newInstance(Object parent) {
            return null;
          }
        });
    desc.setHandler(handler);
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _description
    fieldValidator = new FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      StringValidator sv = new StringValidator();
      sv.setWhiteSpace("preserve");
      fieldValidator.setValidator(sv);
    }
    desc.setValidator(fieldValidator);
  } // -- de.fhg.isst.ComponentML.SecurityRequirementDescriptor()
  public AuditMgrRespDescriptor() {
    super();
    xmlName = "auditMgrResp";

    // -- set grouping compositor
    setCompositorAsChoice();
    XMLFieldDescriptorImpl desc = null;
    XMLFieldHandler handler = null;
    FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- initialize element descriptors

    // -- _auditLogEntriesList
    desc =
        new XMLFieldDescriptorImpl(
            AuditLogEntries.class, "_auditLogEntriesList", "auditLogEntries", NodeType.Element);
    handler =
        (new XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            AuditMgrResp target = (AuditMgrResp) object;
            return target.getAuditLogEntries();
          }

          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              AuditMgrResp target = (AuditMgrResp) object;
              target.addAuditLogEntries((AuditLogEntries) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public java.lang.Object newInstance(java.lang.Object parent) {
            return new AuditLogEntries();
          }
        });
    desc.setHandler(handler);
    desc.setRequired(true);
    desc.setMultivalued(true);
    addFieldDescriptor(desc);

    // -- validation code for: _auditLogEntriesList
    fieldValidator = new FieldValidator();
    fieldValidator.setMinOccurs(0);
    desc.setValidator(fieldValidator);

    // -- _noDataResponse
    desc =
        new XMLFieldDescriptorImpl(
            java.lang.String.class, "_noDataResponse", "noDataResponse", NodeType.Element);
    desc.setImmutable(true);
    handler =
        (new XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            AuditMgrResp target = (AuditMgrResp) object;
            return target.getNoDataResponse();
          }

          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              AuditMgrResp target = (AuditMgrResp) object;
              target.setNoDataResponse((java.lang.String) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        });
    desc.setHandler(handler);
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _noDataResponse
    fieldValidator = new FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      StringValidator sv = new StringValidator();
      sv.setWhiteSpace("preserve");
      fieldValidator.setValidator(sv);
    }
    desc.setValidator(fieldValidator);
  } // -- com.cisco.eManager.common.audit2.AuditMgrRespDescriptor()
Esempio n. 3
0
  public TestDescriptorDescriptor() {
    super();
    nsURI = "http://castor.exolab.org/Test";
    xmlName = "TestDescriptor";

    // -- set grouping compositor
    setCompositorAsSequence();
    XMLFieldDescriptorImpl desc = null;
    XMLFieldHandler handler = null;
    FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- initialize element descriptors

    // -- _name
    desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_name", "Name", NodeType.Element);
    desc.setImmutable(true);
    handler =
        (new XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            TestDescriptor target = (TestDescriptor) object;
            return target.getName();
          }

          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              TestDescriptor target = (TestDescriptor) object;
              target.setName((java.lang.String) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://castor.exolab.org/Test");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _name
    fieldValidator = new FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      StringValidator sv = new StringValidator();
      sv.setWhiteSpace("preserve");
      fieldValidator.setValidator(sv);
    }
    desc.setValidator(fieldValidator);

    // -- _author
    desc =
        new XMLFieldDescriptorImpl(java.lang.String.class, "_author", "Author", NodeType.Element);
    desc.setImmutable(true);
    handler =
        (new XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            TestDescriptor target = (TestDescriptor) object;
            return target.getAuthor();
          }

          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              TestDescriptor target = (TestDescriptor) object;
              target.setAuthor((java.lang.String) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://castor.exolab.org/Test");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _author
    fieldValidator = new FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      StringValidator sv = new StringValidator();
      sv.setWhiteSpace("preserve");
      fieldValidator.setValidator(sv);
    }
    desc.setValidator(fieldValidator);

    // -- _commentList
    desc =
        new XMLFieldDescriptorImpl(
            java.lang.String.class, "_commentList", "Comment", NodeType.Element);
    desc.setImmutable(true);
    handler =
        (new XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            TestDescriptor target = (TestDescriptor) object;
            return target.getComment();
          }

          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              TestDescriptor target = (TestDescriptor) object;
              target.addComment((java.lang.String) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://castor.exolab.org/Test");
    desc.setRequired(true);
    desc.setMultivalued(true);
    addFieldDescriptor(desc);

    // -- validation code for: _commentList
    fieldValidator = new FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      StringValidator sv = new StringValidator();
      sv.setWhiteSpace("preserve");
      fieldValidator.setValidator(sv);
    }
    desc.setValidator(fieldValidator);

    // -- _category
    desc =
        new XMLFieldDescriptorImpl(
            org.exolab.castor.tests.framework.testDescriptor.types.CategoryType.class,
            "_category",
            "Category",
            NodeType.Element);
    handler =
        (new XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            TestDescriptor target = (TestDescriptor) object;
            return target.getCategory();
          }

          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              TestDescriptor target = (TestDescriptor) object;
              target.setCategory(
                  (org.exolab.castor.tests.framework.testDescriptor.types.CategoryType) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        });
    desc.setHandler(
        new EnumFieldHandler(
            org.exolab.castor.tests.framework.testDescriptor.types.CategoryType.class, handler));
    desc.setImmutable(true);
    desc.setNameSpaceURI("http://castor.exolab.org/Test");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _category
    fieldValidator = new FieldValidator();
    fieldValidator.setMinOccurs(1);
    desc.setValidator(fieldValidator);

    // -- _bugFix
    desc = new XMLFieldDescriptorImpl(BugFix.class, "_bugFix", "BugFix", NodeType.Element);
    handler =
        (new XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            TestDescriptor target = (TestDescriptor) object;
            return target.getBugFix();
          }

          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              TestDescriptor target = (TestDescriptor) object;
              target.setBugFix((BugFix) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public java.lang.Object newInstance(java.lang.Object parent) {
            return new BugFix();
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://castor.exolab.org/Test");
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _bugFix
    fieldValidator = new FieldValidator();
    desc.setValidator(fieldValidator);

    // -- _testDescriptorChoice
    desc =
        new XMLFieldDescriptorImpl(
            TestDescriptorChoice.class,
            "_testDescriptorChoice",
            "-error-if-this-is-used-",
            NodeType.Element);
    handler =
        (new XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            TestDescriptor target = (TestDescriptor) object;
            return target.getTestDescriptorChoice();
          }

          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              TestDescriptor target = (TestDescriptor) object;
              target.setTestDescriptorChoice((TestDescriptorChoice) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public java.lang.Object newInstance(java.lang.Object parent) {
            return new TestDescriptorChoice();
          }
        });
    desc.setHandler(handler);
    desc.setContainer(true);
    desc.setClassDescriptor(new TestDescriptorChoiceDescriptor());
    desc.setNameSpaceURI("http://castor.exolab.org/Test");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _testDescriptorChoice
    fieldValidator = new FieldValidator();
    fieldValidator.setMinOccurs(1);
    desc.setValidator(fieldValidator);
  } // -- org.exolab.castor.tests.framework.testDescriptor.TestDescriptorDescriptor()
Esempio n. 4
0
  public FieldMappingDescriptor() {
    super();
    nsURI = "http://castor.exolab.org/";
    xmlName = "field";
    XMLFieldDescriptorImpl desc = null;
    XMLFieldHandler handler = null;
    FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- _name
    desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", NodeType.Attribute);
    handler =
        (new XMLFieldHandler() {
          public Object getValue(Object object) throws IllegalStateException {
            FieldMapping target = (FieldMapping) object;
            return target.getName();
          }

          public void setValue(Object object, Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              FieldMapping target = (FieldMapping) object;
              target.setName((java.lang.String) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public Object newInstance(Object parent) {
            return new java.lang.String();
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://castor.exolab.org/");
    desc.setRequired(true);
    addFieldDescriptor(desc);

    // -- validation code for: _name
    fieldValidator = new FieldValidator();
    fieldValidator.setMinOccurs(1);
    fieldValidator.setValidator(new NameValidator(NameValidator.NMTOKEN));
    desc.setValidator(fieldValidator);

    // -- _type
    desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_type", "type", NodeType.Attribute);
    handler =
        (new XMLFieldHandler() {
          public Object getValue(Object object) throws IllegalStateException {
            FieldMapping target = (FieldMapping) object;
            return target.getType();
          }

          public void setValue(Object object, Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              FieldMapping target = (FieldMapping) object;
              target.setType((java.lang.String) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public Object newInstance(Object parent) {
            return new java.lang.String();
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://castor.exolab.org/");
    addFieldDescriptor(desc);

    // -- validation code for: _type
    fieldValidator = new FieldValidator();
    fieldValidator.setValidator(new NameValidator(NameValidator.NMTOKEN));
    desc.setValidator(fieldValidator);

    // -- _required
    desc =
        new XMLFieldDescriptorImpl(
            java.lang.Boolean.TYPE, "_required", "required", NodeType.Attribute);
    handler =
        (new XMLFieldHandler() {
          public Object getValue(Object object) throws IllegalStateException {
            FieldMapping target = (FieldMapping) object;
            if (!target.hasRequired()) return null;
            return new Boolean(target.getRequired());
          }

          public void setValue(Object object, Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              FieldMapping target = (FieldMapping) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteRequired();
                return;
              }
              target.setRequired(((Boolean) value).booleanValue());
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public Object newInstance(Object parent) {
            return null;
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://castor.exolab.org/");
    addFieldDescriptor(desc);

    // -- validation code for: _required
    fieldValidator = new FieldValidator();
    desc.setValidator(fieldValidator);

    // -- _transient
    desc =
        new XMLFieldDescriptorImpl(
            java.lang.Boolean.TYPE, "_transient", "transient", NodeType.Attribute);
    handler =
        (new XMLFieldHandler() {
          public Object getValue(Object object) throws IllegalStateException {
            FieldMapping target = (FieldMapping) object;
            if (!target.hasTransient()) return null;
            return new Boolean(target.getTransient());
          }

          public void setValue(Object object, Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              FieldMapping target = (FieldMapping) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteTransient();
                return;
              }
              target.setTransient(((Boolean) value).booleanValue());
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public Object newInstance(Object parent) {
            return null;
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://castor.exolab.org/");
    addFieldDescriptor(desc);

    // -- validation code for: _transient
    fieldValidator = new FieldValidator();
    desc.setValidator(fieldValidator);

    // -- _direct
    desc =
        new XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_direct", "direct", NodeType.Attribute);
    handler =
        (new XMLFieldHandler() {
          public Object getValue(Object object) throws IllegalStateException {
            FieldMapping target = (FieldMapping) object;
            if (!target.hasDirect()) return null;
            return new Boolean(target.getDirect());
          }

          public void setValue(Object object, Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              FieldMapping target = (FieldMapping) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteDirect();
                return;
              }
              target.setDirect(((Boolean) value).booleanValue());
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public Object newInstance(Object parent) {
            return null;
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://castor.exolab.org/");
    addFieldDescriptor(desc);

    // -- validation code for: _direct
    fieldValidator = new FieldValidator();
    desc.setValidator(fieldValidator);

    // -- _lazy
    desc = new XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_lazy", "lazy", NodeType.Attribute);
    handler =
        (new XMLFieldHandler() {
          public Object getValue(Object object) throws IllegalStateException {
            FieldMapping target = (FieldMapping) object;
            if (!target.hasLazy()) return null;
            return new Boolean(target.getLazy());
          }

          public void setValue(Object object, Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              FieldMapping target = (FieldMapping) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteLazy();
                return;
              }
              target.setLazy(((Boolean) value).booleanValue());
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public Object newInstance(Object parent) {
            return null;
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://castor.exolab.org/");
    addFieldDescriptor(desc);

    // -- validation code for: _lazy
    fieldValidator = new FieldValidator();
    desc.setValidator(fieldValidator);

    // -- _container
    desc =
        new XMLFieldDescriptorImpl(
            java.lang.Boolean.TYPE, "_container", "container", NodeType.Attribute);
    handler =
        (new XMLFieldHandler() {
          public Object getValue(Object object) throws IllegalStateException {
            FieldMapping target = (FieldMapping) object;
            if (!target.hasContainer()) return null;
            return new Boolean(target.getContainer());
          }

          public void setValue(Object object, Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              FieldMapping target = (FieldMapping) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteContainer();
                return;
              }
              target.setContainer(((Boolean) value).booleanValue());
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public Object newInstance(Object parent) {
            return null;
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://castor.exolab.org/");
    addFieldDescriptor(desc);

    // -- validation code for: _container
    fieldValidator = new FieldValidator();
    desc.setValidator(fieldValidator);

    // -- _getMethod
    desc =
        new XMLFieldDescriptorImpl(
            java.lang.String.class, "_getMethod", "get-method", NodeType.Attribute);
    handler =
        (new XMLFieldHandler() {
          public Object getValue(Object object) throws IllegalStateException {
            FieldMapping target = (FieldMapping) object;
            return target.getGetMethod();
          }

          public void setValue(Object object, Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              FieldMapping target = (FieldMapping) object;
              target.setGetMethod((java.lang.String) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public Object newInstance(Object parent) {
            return new java.lang.String();
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://castor.exolab.org/");
    addFieldDescriptor(desc);

    // -- validation code for: _getMethod
    fieldValidator = new FieldValidator();
    fieldValidator.setValidator(new NameValidator(NameValidator.NMTOKEN));
    desc.setValidator(fieldValidator);

    // -- _setMethod
    desc =
        new XMLFieldDescriptorImpl(
            java.lang.String.class, "_setMethod", "set-method", NodeType.Attribute);
    handler =
        (new XMLFieldHandler() {
          public Object getValue(Object object) throws IllegalStateException {
            FieldMapping target = (FieldMapping) object;
            return target.getSetMethod();
          }

          public void setValue(Object object, Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              FieldMapping target = (FieldMapping) object;
              target.setSetMethod((java.lang.String) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public Object newInstance(Object parent) {
            return new java.lang.String();
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://castor.exolab.org/");
    addFieldDescriptor(desc);

    // -- validation code for: _setMethod
    fieldValidator = new FieldValidator();
    fieldValidator.setValidator(new NameValidator(NameValidator.NMTOKEN));
    desc.setValidator(fieldValidator);

    // -- _createMethod
    desc =
        new XMLFieldDescriptorImpl(
            java.lang.String.class, "_createMethod", "create-method", NodeType.Attribute);
    handler =
        (new XMLFieldHandler() {
          public Object getValue(Object object) throws IllegalStateException {
            FieldMapping target = (FieldMapping) object;
            return target.getCreateMethod();
          }

          public void setValue(Object object, Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              FieldMapping target = (FieldMapping) object;
              target.setCreateMethod((java.lang.String) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public Object newInstance(Object parent) {
            return new java.lang.String();
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://castor.exolab.org/");
    addFieldDescriptor(desc);

    // -- validation code for: _createMethod
    fieldValidator = new FieldValidator();
    fieldValidator.setValidator(new NameValidator(NameValidator.NMTOKEN));
    desc.setValidator(fieldValidator);

    // -- _collection
    desc =
        new XMLFieldDescriptorImpl(
            org.exolab.castor.mapping.xml.types.CollectionType.class,
            "_collection",
            "collection",
            NodeType.Attribute);
    handler =
        (new XMLFieldHandler() {
          public Object getValue(Object object) throws IllegalStateException {
            FieldMapping target = (FieldMapping) object;
            return target.getCollection();
          }

          public void setValue(Object object, Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              FieldMapping target = (FieldMapping) object;
              target.setCollection((org.exolab.castor.mapping.xml.types.CollectionType) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public Object newInstance(Object parent) {
            return null;
          }
        });
    desc.setHandler(
        new EnumFieldHandler(org.exolab.castor.mapping.xml.types.CollectionType.class, handler));
    desc.setImmutable(true);
    desc.setNameSpaceURI("http://castor.exolab.org/");
    addFieldDescriptor(desc);

    // -- validation code for: _collection
    fieldValidator = new FieldValidator();
    desc.setValidator(fieldValidator);

    // -- initialize element descriptors

    // -- _description
    desc =
        new XMLFieldDescriptorImpl(
            java.lang.String.class, "_description", "description", NodeType.Element);
    desc.setImmutable(true);
    handler =
        (new XMLFieldHandler() {
          public Object getValue(Object object) throws IllegalStateException {
            FieldMapping target = (FieldMapping) object;
            return target.getDescription();
          }

          public void setValue(Object object, Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              FieldMapping target = (FieldMapping) object;
              target.setDescription((java.lang.String) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public Object newInstance(Object parent) {
            return null;
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://castor.exolab.org/");
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _description
    fieldValidator = new FieldValidator();
    { // -- local scope
      StringValidator sv = new StringValidator();
      sv.setWhiteSpace("preserve");
      fieldValidator.setValidator(sv);
    }
    desc.setValidator(fieldValidator);

    // -- _sql
    desc = new XMLFieldDescriptorImpl(Sql.class, "_sql", "sql", NodeType.Element);
    handler =
        (new XMLFieldHandler() {
          public Object getValue(Object object) throws IllegalStateException {
            FieldMapping target = (FieldMapping) object;
            return target.getSql();
          }

          public void setValue(Object object, Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              FieldMapping target = (FieldMapping) object;
              target.setSql((Sql) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public Object newInstance(Object parent) {
            return new Sql();
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://castor.exolab.org/");
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _sql
    fieldValidator = new FieldValidator();
    desc.setValidator(fieldValidator);

    // -- _bindXml
    desc = new XMLFieldDescriptorImpl(BindXml.class, "_bindXml", "bind-xml", NodeType.Element);
    // BACKWARD COMPATIBILITY
    desc.setMatches("bind-xml xml");
    handler =
        (new XMLFieldHandler() {
          public Object getValue(Object object) throws IllegalStateException {
            FieldMapping target = (FieldMapping) object;
            return target.getBindXml();
          }

          public void setValue(Object object, Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              FieldMapping target = (FieldMapping) object;
              target.setBindXml((BindXml) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public Object newInstance(Object parent) {
            return new BindXml();
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://castor.exolab.org/");
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _bindXml
    fieldValidator = new FieldValidator();
    desc.setValidator(fieldValidator);

    // -- _ldap
    desc = new XMLFieldDescriptorImpl(Ldap.class, "_ldap", "ldap", NodeType.Element);
    handler =
        (new XMLFieldHandler() {
          public Object getValue(Object object) throws IllegalStateException {
            FieldMapping target = (FieldMapping) object;
            return target.getLdap();
          }

          public void setValue(Object object, Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              FieldMapping target = (FieldMapping) object;
              target.setLdap((Ldap) value);
            } catch (Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public Object newInstance(Object parent) {
            return new Ldap();
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://castor.exolab.org/");
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _ldap
    fieldValidator = new FieldValidator();
    desc.setValidator(fieldValidator);
  } // -- org.exolab.castor.mapping.xml.FieldMappingDescriptor()