Exemplo n.º 1
0
  public MaximumVersionDescriptor() {
    super();
    _nsURI = "http://ltsc.ieee.org/xsd/LOM";
    _xmlName = "maximumVersion";
    _elementDefinition = false;

    // -- set grouping compositor
    setCompositorAsSequence();
    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    org.exolab.castor.mapping.FieldHandler handler = null;
    org.exolab.castor.xml.FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- initialize element descriptors

    // -- _groupMaximumVersionMaximumVersion
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            es.pode.parseadorXML.castor.GroupMaximumVersionMaximumVersion.class,
            "_groupMaximumVersionMaximumVersion",
            "maximumVersion",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            MaximumVersion target = (MaximumVersion) object;
            return target.getGroupMaximumVersionMaximumVersion();
          }

          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              MaximumVersion target = (MaximumVersion) object;
              target.setGroupMaximumVersionMaximumVersion(
                  (es.pode.parseadorXML.castor.GroupMaximumVersionMaximumVersion) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public java.lang.Object newInstance(java.lang.Object parent) {
            return new es.pode.parseadorXML.castor.GroupMaximumVersionMaximumVersion();
          }
        };
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://ltsc.ieee.org/xsd/LOM");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _groupMaximumVersionMaximumVersion
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
  }
  public MultPartTypeDescriptor() {
    super();
    nsURI = "http://www.brandbank.com/2007/12";
    xmlName = "MultPartType";
    elementDefinition = false;

    // -- set grouping compositor
    setCompositorAsSequence();
    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    org.exolab.castor.mapping.FieldHandler handler = null;
    org.exolab.castor.xml.FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- initialize element descriptors

    // -- _partList
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            com.pg.brandbank.Part.class,
            "_partList",
            "Part",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            MultPartType target = (MultPartType) object;
            return target.getPart();
          }

          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              MultPartType target = (MultPartType) object;
              target.addPart((com.pg.brandbank.Part) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public java.lang.Object newInstance(java.lang.Object parent) {
            return new com.pg.brandbank.Part();
          }
        };
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://www.brandbank.com/2007/12");
    desc.setMultivalued(true);
    addFieldDescriptor(desc);

    // -- validation code for: _partList
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(0);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
  } // -- com.pg.brandbank.MultPartTypeDescriptor()
Exemplo n.º 3
0
  public TopicsDescriptor() {
    super();
    nsURI = "http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content";
    xmlName = "topics";
    XMLFieldDescriptorImpl desc = null;
    XMLFieldHandler handler = null;
    FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- initialize element descriptors

    // -- _entryList
    desc = new XMLFieldDescriptorImpl(Entry.class, "_entryList", "entry", NodeType.Element);
    handler =
        (new XMLFieldHandler() {
          public Object getValue(Object object) throws IllegalStateException {
            Topics target = (Topics) object;
            return target.getEntry();
          }

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

          public Object newInstance(Object parent) {
            return new Entry();
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://jakarta.apache.org/jetspeed/xml/jetspeed-portal-content");
    desc.setRequired(true);
    desc.setMultivalued(true);
    addFieldDescriptor(desc);

    // -- validation code for: _entryList
    fieldValidator = new FieldValidator();
    fieldValidator.setMinOccurs(1);
    desc.setValidator(fieldValidator);
  } // -- org.apache.jetspeed.xml.api.jcm.TopicsDescriptor()
Exemplo n.º 4
0
  public CacheTypeMappingDescriptor() {
    super();
    nsURI = "http://castor.exolab.org/";
    xmlName = "cache-type";
    elementDefinition = true;

    // -- set grouping compositor
    setCompositorAsSequence();
    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    org.exolab.castor.mapping.FieldHandler handler = null;
    org.exolab.castor.xml.FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- _type
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class, "_type", "type", org.exolab.castor.xml.NodeType.Attribute);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            CacheTypeMapping target = (CacheTypeMapping) object;
            return target.getType();
          }

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

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

    // -- validation code for: _type
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator =
          new org.exolab.castor.xml.validators.StringValidator();
      typeValidator.setWhiteSpace("preserve");
      fieldValidator.setValidator(typeValidator);
    }
    desc.setValidator(fieldValidator);
    // -- _debug
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Boolean.TYPE, "_debug", "debug", org.exolab.castor.xml.NodeType.Attribute);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            CacheTypeMapping target = (CacheTypeMapping) object;
            if (!target.hasDebug()) return null;
            return (target.getDebug() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
          }

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

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

    // -- validation code for: _debug
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.BooleanValidator typeValidator =
          new org.exolab.castor.xml.validators.BooleanValidator();
      fieldValidator.setValidator(typeValidator);
    }
    desc.setValidator(fieldValidator);
    // -- _capacity
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Long.TYPE, "_capacity", "capacity", org.exolab.castor.xml.NodeType.Attribute);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            CacheTypeMapping target = (CacheTypeMapping) object;
            if (!target.hasCapacity()) return null;
            return new java.lang.Long(target.getCapacity());
          }

          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              CacheTypeMapping target = (CacheTypeMapping) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteCapacity();
                return;
              }
              target.setCapacity(((java.lang.Long) value).longValue());
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

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

    // -- validation code for: _capacity
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.IntegerValidator typeValidator =
          new org.exolab.castor.xml.validators.IntegerValidator();
      fieldValidator.setValidator(typeValidator);
    }
    desc.setValidator(fieldValidator);
    // -- initialize element descriptors

    // -- _paramList
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            org.exolab.castor.mapping.xml.Param.class,
            "_paramList",
            "param",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            CacheTypeMapping target = (CacheTypeMapping) object;
            return target.getParam();
          }

          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              CacheTypeMapping target = (CacheTypeMapping) object;
              target.addParam((org.exolab.castor.mapping.xml.Param) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

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

    // -- validation code for: _paramList
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(0);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
  } // -- org.exolab.castor.mapping.xml.CacheTypeMappingDescriptor()
Exemplo n.º 5
0
  public MarshallingTestDescriptor() {
    super();
    nsURI = "http://castor.exolab.org/Test";
    xmlName = "MarshallingTest";

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

    // -- initialize element descriptors

    // -- _root_Object
    desc =
        new XMLFieldDescriptorImpl(
            Root_Object.class, "_root_Object", "Root_Object", NodeType.Element);
    handler =
        (new XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            MarshallingTest target = (MarshallingTest) object;
            return target.getRoot_Object();
          }

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

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

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

    // -- _unitTestCaseList
    desc =
        new XMLFieldDescriptorImpl(
            UnitTestCase.class, "_unitTestCaseList", "UnitTestCase", NodeType.Element);
    handler =
        (new XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            MarshallingTest target = (MarshallingTest) object;
            return target.getUnitTestCase();
          }

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

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

    // -- validation code for: _unitTestCaseList
    fieldValidator = new FieldValidator();
    fieldValidator.setMinOccurs(1);
    desc.setValidator(fieldValidator);
  } // -- org.exolab.castor.tests.framework.testDescriptor.MarshallingTestDescriptor()
Exemplo n.º 6
0
  public EventSetDescriptor() {
    super();
    setExtendsWithoutFlatten(new eu.dca.model.descriptors.EventSetComplexTypeDescriptor());
    _nsURI = "http://www.lido-schema.org";
    _xmlName = "eventSet";
    _elementDefinition = true;
    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    org.exolab.castor.mapping.FieldHandler handler = null;
    org.exolab.castor.xml.FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- _sortorder
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Long.TYPE,
            "_sortorder",
            "sortorder",
            org.exolab.castor.xml.NodeType.Attribute);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            EventSet target = (EventSet) object;
            if (!target.hasSortorder()) {
              return null;
            }
            return new java.lang.Long(target.getSortorder());
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              EventSet target = (EventSet) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteSortorder();
                return;
              }
              target.setSortorder(((java.lang.Long) value).longValue());
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("integer");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://www.lido-schema.org");
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _sortorder
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.LongValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.LongValidator();
      fieldValidator.setValidator(typeValidator);
    }
    desc.setValidator(fieldValidator);
    // -- initialize element descriptors

  }
Exemplo n.º 7
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()
Exemplo n.º 8
0
  public SystemsDescriptor() {
    super();
    _nsURI = "http://xmlns.opennms.org/xsd/config/datacollection";
    _xmlName = "systems";
    _elementDefinition = true;

    // -- set grouping compositor
    setCompositorAsSequence();
    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    org.exolab.castor.mapping.FieldHandler handler = null;
    org.exolab.castor.xml.FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- initialize element descriptors

    // -- _systemDefList
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            org.opennms.netmgt.config.datacollection.SystemDef.class,
            "_systemDefList",
            "systemDef",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Systems target = (Systems) object;
            return target.getSystemDef();
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Systems target = (Systems) object;
              target.addSystemDef((org.opennms.netmgt.config.datacollection.SystemDef) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          public void resetValue(Object object)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Systems target = (Systems) object;
              target.removeAllSystemDef();
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return new org.opennms.netmgt.config.datacollection.SystemDef();
          }
        };
    desc.setSchemaType("org.opennms.netmgt.config.datacollection.SystemDef");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/config/datacollection");
    desc.setRequired(true);
    desc.setMultivalued(true);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _systemDefList
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
  }
Exemplo n.º 9
0
  public RowDescriptor() {
    super();
    _nsURI = "http://xmlns.opennms.org/xsd/report/availability";
    _xmlName = "row";
    _elementDefinition = true;

    // -- set grouping compositor
    setCompositorAsSequence();
    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    org.exolab.castor.mapping.FieldHandler handler = null;
    org.exolab.castor.xml.FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- initialize element descriptors

    // -- _valueList
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            org.opennms.reporting.availability.Value.class,
            "_valueList",
            "value",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Row target = (Row) object;
            return target.getValue();
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Row target = (Row) object;
              target.addValue((org.opennms.reporting.availability.Value) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public void resetValue(Object object)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Row target = (Row) object;
              target.removeAllValue();
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return new org.opennms.reporting.availability.Value();
          }
        };
    desc.setSchemaType("org.opennms.reporting.availability.Value");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/report/availability");
    desc.setMultivalued(true);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _valueList
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(0);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
  }
Exemplo n.º 10
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()
Exemplo n.º 11
0
  /** ----------------/ - Constructors -/ ----------------/ */
  public RelationsDescriptor() {
    super();
    nsURI = "http://www.cismet.de/cids";
    xmlName = "relations";

    // -- set grouping compositor
    setCompositorAsSequence();
    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    org.exolab.castor.xml.XMLFieldHandler handler = null;
    org.exolab.castor.xml.FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- initialize element descriptors

    // -- _relationList
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            de.cismet.jpresso.core.deprecated.castorGenerated.Relation.class,
            "_relationList",
            "relation",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        (new org.exolab.castor.xml.XMLFieldHandler() {

          @Override
          public java.lang.Object getValue(final java.lang.Object object)
              throws IllegalStateException {
            final Relations target = (Relations) object;
            return target.getRelation();
          }

          @Override
          public void setValue(final java.lang.Object object, final java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              final Relations target = (Relations) object;
              target.addRelation(
                  (de.cismet.jpresso.core.deprecated.castorGenerated.Relation) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          public java.lang.Object newInstance(final java.lang.Object parent) {
            return new de.cismet.jpresso.core.deprecated.castorGenerated.Relation();
          }
        });
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://www.cismet.de/cids");
    desc.setRequired(true);
    desc.setMultivalued(true);
    addFieldDescriptor(desc);

    // -- validation code for: _relationList
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
  } // -- de.cismet.cids.admin.importAnt.castorGenerated.RelationsDescriptor()
  public RelatedWorksWrapDescriptor() {
    super();
    _nsURI = "http://www.lido-schema.org";
    _xmlName = "relatedWorksWrap";
    _elementDefinition = true;

    // -- set grouping compositor
    setCompositorAsSequence();
    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    org.exolab.castor.mapping.FieldHandler handler = null;
    org.exolab.castor.xml.FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- initialize element descriptors

    // -- _relatedWorkSetList
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            eu.dca.model.RelatedWorkSet.class,
            "_relatedWorkSetList",
            "relatedWorkSet",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            RelatedWorksWrap target = (RelatedWorksWrap) object;
            return target.getRelatedWorkSet();
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              RelatedWorksWrap target = (RelatedWorksWrap) object;
              target.addRelatedWorkSet((eu.dca.model.RelatedWorkSet) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public void resetValue(Object object)
              throws IllegalStateException, IllegalArgumentException {
            try {
              RelatedWorksWrap target = (RelatedWorksWrap) object;
              target.removeAllRelatedWorkSet();
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("list");
    desc.setComponentType("eu.dca.model.RelatedWorkSet");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://www.lido-schema.org");
    desc.setMultivalued(true);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _relatedWorkSetList
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(0);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
  }
Exemplo n.º 13
0
  public TransactionDescriptor() {
    super();
    nsURI = "http://www.example.org/Transaction_psiahu";
    xmlName = "Transaction";

    // -- set grouping compositor
    setCompositorAsSequence();
    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    org.exolab.castor.mapping.FieldHandler handler = null;
    org.exolab.castor.xml.FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- initialize element descriptors

    // -- _transactionType
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            au.com.suncorp.dm.tx.types.TransactionTypeType.class,
            "_transactionType",
            "TransactionType",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Transaction target = (Transaction) object;
            return target.getTransactionType();
          }

          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Transaction target = (Transaction) object;
              target.setTransactionType((au.com.suncorp.dm.tx.types.TransactionTypeType) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    handler =
        new org.exolab.castor.xml.handlers.EnumFieldHandler(
            au.com.suncorp.dm.tx.types.TransactionTypeType.class, handler);
    desc.setImmutable(true);
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://www.example.org/Transaction_psiahu");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _transactionType
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
    // -- _amount
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.math.BigDecimal.class,
            "_amount",
            "Amount",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Transaction target = (Transaction) object;
            return target.getAmount();
          }

          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Transaction target = (Transaction) object;
              target.setAmount((java.math.BigDecimal) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public java.lang.Object newInstance(java.lang.Object parent) {
            return new java.math.BigDecimal(0);
          }
        };
    desc.setImmutable(true);
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://www.example.org/Transaction_psiahu");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _amount
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      DecimalValidator typeValidator = new DecimalValidator();
      fieldValidator.setValidator(typeValidator);
    }
    desc.setValidator(fieldValidator);
    // -- _createDate
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.util.Date.class,
            "_createDate",
            "CreateDate",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Transaction target = (Transaction) object;
            return target.getCreateDate();
          }

          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Transaction target = (Transaction) object;
              target.setCreateDate((java.util.Date) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public java.lang.Object newInstance(java.lang.Object parent) {
            return new java.util.Date();
          }
        };
    handler = new org.exolab.castor.xml.handlers.DateFieldHandler(handler);
    desc.setImmutable(true);
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://www.example.org/Transaction_psiahu");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _createDate
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
    // -- _description
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class,
            "_description",
            "Description",
            org.exolab.castor.xml.NodeType.Element);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Transaction target = (Transaction) object;
            return target.getDescription();
          }

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

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

    // -- validation code for: _description
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      StringValidator typeValidator = new StringValidator();
      typeValidator.setWhiteSpace("preserve");
      fieldValidator.setValidator(typeValidator);
    }
    desc.setValidator(fieldValidator);
  } // -- au.com.suncorp.dm.tx.TransactionDescriptor()
  public GetPolicyResponseTypeDescriptor() {
    super();
    nsURI = "urn:ais:schema:insurance:policy";
    xmlName = "GetPolicyResponseType";

    // -- set grouping compositor
    setCompositorAsSequence();
    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    org.exolab.castor.mapping.FieldHandler handler = null;
    org.exolab.castor.xml.FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- initialize element descriptors

    // -- _policyResponseGIHeader
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            au.com.suncorp.dm.getpolicyFE.PolicyResponseGIHeader.class,
            "_policyResponseGIHeader",
            "GIHeader",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            GetPolicyResponseType target = (GetPolicyResponseType) object;
            return target.getPolicyResponseGIHeader();
          }

          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              GetPolicyResponseType target = (GetPolicyResponseType) object;
              target.setPolicyResponseGIHeader(
                  (au.com.suncorp.dm.getpolicyFE.PolicyResponseGIHeader) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public java.lang.Object newInstance(java.lang.Object parent) {
            return new au.com.suncorp.dm.getpolicyFE.PolicyResponseGIHeader();
          }
        };
    desc.setHandler(handler);
    desc.setNameSpaceURI("urn:ais:schema:insurance:policy");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _policyResponseGIHeader
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
    // -- _policyResponseBusinessData
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            au.com.suncorp.dm.getpolicyFE.PolicyResponseBusinessData.class,
            "_policyResponseBusinessData",
            "BusinessData",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            GetPolicyResponseType target = (GetPolicyResponseType) object;
            return target.getPolicyResponseBusinessData();
          }

          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              GetPolicyResponseType target = (GetPolicyResponseType) object;
              target.setPolicyResponseBusinessData(
                  (au.com.suncorp.dm.getpolicyFE.PolicyResponseBusinessData) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public java.lang.Object newInstance(java.lang.Object parent) {
            return new au.com.suncorp.dm.getpolicyFE.PolicyResponseBusinessData();
          }
        };
    desc.setHandler(handler);
    desc.setNameSpaceURI("urn:ais:schema:insurance:policy");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _policyResponseBusinessData
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
  } // -- au.com.suncorp.dm.getpolicyFE.GetPolicyResponseTypeDescriptor()
Exemplo n.º 15
0
  public ViewInfoDescriptor() {
    super();
    _nsURI = "http://xmlns.opennms.org/xsd/report/availability";
    _xmlName = "viewInfo";
    _elementDefinition = true;

    // -- set grouping compositor
    setCompositorAsSequence();
    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    org.exolab.castor.mapping.FieldHandler handler = null;
    org.exolab.castor.xml.FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- initialize element descriptors

    // -- _viewName
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class,
            "_viewName",
            "viewName",
            org.exolab.castor.xml.NodeType.Element);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            ViewInfo target = (ViewInfo) object;
            return target.getViewName();
          }

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

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/report/availability");
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _viewName
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    // -- _viewTitle
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class,
            "_viewTitle",
            "viewTitle",
            org.exolab.castor.xml.NodeType.Element);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            ViewInfo target = (ViewInfo) object;
            return target.getViewTitle();
          }

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

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/report/availability");
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _viewTitle
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    // -- _viewComments
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class,
            "_viewComments",
            "viewComments",
            org.exolab.castor.xml.NodeType.Element);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            ViewInfo target = (ViewInfo) object;
            return target.getViewComments();
          }

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

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/report/availability");
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _viewComments
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
  }
Exemplo n.º 16
0
  public PostalAddressDescriptor() {
    super();
    _nsURI = "http://mss.ficom.fi/TS102204/v1.0.0#";
    _xmlName = "PostalAddress";
    _elementDefinition = true;

    // -- set grouping compositor
    setCompositorAsSequence();
    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    org.exolab.castor.mapping.FieldHandler handler = null;
    org.exolab.castor.xml.FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- initialize element descriptors

    // -- _name
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class, "_name", "Name", org.exolab.castor.xml.NodeType.Element);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            PostalAddress target = (PostalAddress) object;
            return target.getName();
          }

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

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://mss.ficom.fi/TS102204/v1.0.0#");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _name
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    // -- _streetAddress
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class,
            "_streetAddress",
            "StreetAddress",
            org.exolab.castor.xml.NodeType.Element);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            PostalAddress target = (PostalAddress) object;
            return target.getStreetAddress();
          }

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

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://mss.ficom.fi/TS102204/v1.0.0#");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _streetAddress
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    // -- _postalCode
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class,
            "_postalCode",
            "PostalCode",
            org.exolab.castor.xml.NodeType.Element);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            PostalAddress target = (PostalAddress) object;
            return target.getPostalCode();
          }

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

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://mss.ficom.fi/TS102204/v1.0.0#");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _postalCode
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    // -- _town
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class, "_town", "Town", org.exolab.castor.xml.NodeType.Element);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            PostalAddress target = (PostalAddress) object;
            return target.getTown();
          }

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

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://mss.ficom.fi/TS102204/v1.0.0#");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _town
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    // -- _country
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class, "_country", "Country", org.exolab.castor.xml.NodeType.Element);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            PostalAddress target = (PostalAddress) object;
            return target.getCountry();
          }

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

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://mss.ficom.fi/TS102204/v1.0.0#");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _country
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
  }
  public RuleSetDescriptor() {
    super();
    _nsURI = "http://xmlns.opennms.org/xsd/drools-engine";
    _xmlName = "rule-set";
    _elementDefinition = true;

    // -- set grouping compositor
    setCompositorAsSequence();
    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    org.exolab.castor.mapping.FieldHandler handler = null;
    org.exolab.castor.xml.FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- _name
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            RuleSet target = (RuleSet) object;
            return target.getName();
          }

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

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _name
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    // -- initialize element descriptors

    // -- _ruleFileList
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class,
            "_ruleFileList",
            "rule-file",
            org.exolab.castor.xml.NodeType.Element);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            RuleSet target = (RuleSet) object;
            return target.getRuleFile();
          }

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

          public void resetValue(Object object)
              throws IllegalStateException, IllegalArgumentException {
            try {
              RuleSet target = (RuleSet) object;
              target.removeAllRuleFile();
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/drools-engine");
    desc.setRequired(true);
    desc.setMultivalued(true);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _ruleFileList
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    // -- _eventList
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class, "_eventList", "event", org.exolab.castor.xml.NodeType.Element);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            RuleSet target = (RuleSet) object;
            return target.getEvent();
          }

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

          public void resetValue(Object object)
              throws IllegalStateException, IllegalArgumentException {
            try {
              RuleSet target = (RuleSet) object;
              target.removeAllEvent();
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/drools-engine");
    desc.setRequired(true);
    desc.setMultivalued(true);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _eventList
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    // -- _appContext
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class,
            "_appContext",
            "app-context",
            org.exolab.castor.xml.NodeType.Element);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            RuleSet target = (RuleSet) object;
            return target.getAppContext();
          }

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

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/drools-engine");
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _appContext
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    // -- _globalList
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            org.opennms.netmgt.correlation.drools.config.Global.class,
            "_globalList",
            "global",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            RuleSet target = (RuleSet) object;
            return target.getGlobal();
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              RuleSet target = (RuleSet) object;
              target.addGlobal((org.opennms.netmgt.correlation.drools.config.Global) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public void resetValue(Object object)
              throws IllegalStateException, IllegalArgumentException {
            try {
              RuleSet target = (RuleSet) object;
              target.removeAllGlobal();
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return new org.opennms.netmgt.correlation.drools.config.Global();
          }
        };
    desc.setSchemaType("org.opennms.netmgt.correlation.drools.config.Global");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/drools-engine");
    desc.setMultivalued(true);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _globalList
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(0);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
  }
Exemplo n.º 18
0
  public PackageDescriptor() {
    super();
    _nsURI = "http://xmlns.opennms.org/xsd/config/linkd";
    _xmlName = "package";
    _elementDefinition = true;

    // -- set grouping compositor
    setCompositorAsSequence();
    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    org.exolab.castor.mapping.FieldHandler handler = null;
    org.exolab.castor.xml.FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- _name
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Package target = (Package) object;
            return target.getName();
          }

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

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _name
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    // -- _snmp_poll_interval
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Long.TYPE,
            "_snmp_poll_interval",
            "snmp_poll_interval",
            org.exolab.castor.xml.NodeType.Attribute);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Package target = (Package) object;
            if (!target.hasSnmp_poll_interval()) {
              return null;
            }
            return new java.lang.Long(target.getSnmp_poll_interval());
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteSnmp_poll_interval();
                return;
              }
              target.setSnmp_poll_interval(((java.lang.Long) value).longValue());
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("long");
    desc.setHandler(handler);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _snmp_poll_interval
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.LongValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.LongValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setMinInclusive(-9223372036854775808L);
      typeValidator.setMaxInclusive(9223372036854775807L);
    }
    desc.setValidator(fieldValidator);
    // -- _discovery_link_interval
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Long.TYPE,
            "_discovery_link_interval",
            "discovery_link_interval",
            org.exolab.castor.xml.NodeType.Attribute);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Package target = (Package) object;
            if (!target.hasDiscovery_link_interval()) {
              return null;
            }
            return new java.lang.Long(target.getDiscovery_link_interval());
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteDiscovery_link_interval();
                return;
              }
              target.setDiscovery_link_interval(((java.lang.Long) value).longValue());
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("long");
    desc.setHandler(handler);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _discovery_link_interval
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.LongValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.LongValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setMinInclusive(-9223372036854775808L);
      typeValidator.setMaxInclusive(9223372036854775807L);
    }
    desc.setValidator(fieldValidator);
    // -- _autoDiscovery
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Boolean.TYPE,
            "_autoDiscovery",
            "auto-discovery",
            org.exolab.castor.xml.NodeType.Attribute);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Package target = (Package) object;
            if (!target.hasAutoDiscovery()) {
              return null;
            }
            return (target.getAutoDiscovery() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteAutoDiscovery();
                return;
              }
              target.setAutoDiscovery(((java.lang.Boolean) value).booleanValue());
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("boolean");
    desc.setHandler(handler);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _autoDiscovery
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
      fieldValidator.setValidator(typeValidator);
    }
    desc.setValidator(fieldValidator);
    // -- _enableDiscoveryDownload
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Boolean.TYPE,
            "_enableDiscoveryDownload",
            "enable-discovery-download",
            org.exolab.castor.xml.NodeType.Attribute);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Package target = (Package) object;
            if (!target.hasEnableDiscoveryDownload()) {
              return null;
            }
            return (target.getEnableDiscoveryDownload()
                ? java.lang.Boolean.TRUE
                : java.lang.Boolean.FALSE);
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteEnableDiscoveryDownload();
                return;
              }
              target.setEnableDiscoveryDownload(((java.lang.Boolean) value).booleanValue());
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("boolean");
    desc.setHandler(handler);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _enableDiscoveryDownload
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
      fieldValidator.setValidator(typeValidator);
    }
    desc.setValidator(fieldValidator);
    // -- _enableVlanDiscovery
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Boolean.TYPE,
            "_enableVlanDiscovery",
            "enable-vlan-discovery",
            org.exolab.castor.xml.NodeType.Attribute);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Package target = (Package) object;
            if (!target.hasEnableVlanDiscovery()) {
              return null;
            }
            return (target.getEnableVlanDiscovery()
                ? java.lang.Boolean.TRUE
                : java.lang.Boolean.FALSE);
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteEnableVlanDiscovery();
                return;
              }
              target.setEnableVlanDiscovery(((java.lang.Boolean) value).booleanValue());
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("boolean");
    desc.setHandler(handler);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _enableVlanDiscovery
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
      fieldValidator.setValidator(typeValidator);
    }
    desc.setValidator(fieldValidator);
    // -- _useCdpDiscovery
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Boolean.TYPE,
            "_useCdpDiscovery",
            "use-cdp-discovery",
            org.exolab.castor.xml.NodeType.Attribute);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Package target = (Package) object;
            if (!target.hasUseCdpDiscovery()) {
              return null;
            }
            return (target.getUseCdpDiscovery() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteUseCdpDiscovery();
                return;
              }
              target.setUseCdpDiscovery(((java.lang.Boolean) value).booleanValue());
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("boolean");
    desc.setHandler(handler);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _useCdpDiscovery
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
      fieldValidator.setValidator(typeValidator);
    }
    desc.setValidator(fieldValidator);
    // -- _useIpRouteDiscovery
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Boolean.TYPE,
            "_useIpRouteDiscovery",
            "use-ip-route-discovery",
            org.exolab.castor.xml.NodeType.Attribute);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Package target = (Package) object;
            if (!target.hasUseIpRouteDiscovery()) {
              return null;
            }
            return (target.getUseIpRouteDiscovery()
                ? java.lang.Boolean.TRUE
                : java.lang.Boolean.FALSE);
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteUseIpRouteDiscovery();
                return;
              }
              target.setUseIpRouteDiscovery(((java.lang.Boolean) value).booleanValue());
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("boolean");
    desc.setHandler(handler);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _useIpRouteDiscovery
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
      fieldValidator.setValidator(typeValidator);
    }
    desc.setValidator(fieldValidator);
    // -- _useBridgeDiscovery
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Boolean.TYPE,
            "_useBridgeDiscovery",
            "use-bridge-discovery",
            org.exolab.castor.xml.NodeType.Attribute);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Package target = (Package) object;
            if (!target.hasUseBridgeDiscovery()) {
              return null;
            }
            return (target.getUseBridgeDiscovery()
                ? java.lang.Boolean.TRUE
                : java.lang.Boolean.FALSE);
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteUseBridgeDiscovery();
                return;
              }
              target.setUseBridgeDiscovery(((java.lang.Boolean) value).booleanValue());
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("boolean");
    desc.setHandler(handler);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _useBridgeDiscovery
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
      fieldValidator.setValidator(typeValidator);
    }
    desc.setValidator(fieldValidator);
    // -- _saveRouteTable
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Boolean.TYPE,
            "_saveRouteTable",
            "save-route-table",
            org.exolab.castor.xml.NodeType.Attribute);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Package target = (Package) object;
            if (!target.hasSaveRouteTable()) {
              return null;
            }
            return (target.getSaveRouteTable() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteSaveRouteTable();
                return;
              }
              target.setSaveRouteTable(((java.lang.Boolean) value).booleanValue());
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("boolean");
    desc.setHandler(handler);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _saveRouteTable
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
      fieldValidator.setValidator(typeValidator);
    }
    desc.setValidator(fieldValidator);
    // -- _saveStpNodeTable
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Boolean.TYPE,
            "_saveStpNodeTable",
            "save-stp-node-table",
            org.exolab.castor.xml.NodeType.Attribute);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Package target = (Package) object;
            if (!target.hasSaveStpNodeTable()) {
              return null;
            }
            return (target.getSaveStpNodeTable()
                ? java.lang.Boolean.TRUE
                : java.lang.Boolean.FALSE);
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteSaveStpNodeTable();
                return;
              }
              target.setSaveStpNodeTable(((java.lang.Boolean) value).booleanValue());
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("boolean");
    desc.setHandler(handler);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _saveStpNodeTable
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
      fieldValidator.setValidator(typeValidator);
    }
    desc.setValidator(fieldValidator);
    // -- _saveStpInterfaceTable
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Boolean.TYPE,
            "_saveStpInterfaceTable",
            "save-stp-interface-table",
            org.exolab.castor.xml.NodeType.Attribute);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Package target = (Package) object;
            if (!target.hasSaveStpInterfaceTable()) {
              return null;
            }
            return (target.getSaveStpInterfaceTable()
                ? java.lang.Boolean.TRUE
                : java.lang.Boolean.FALSE);
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteSaveStpInterfaceTable();
                return;
              }
              target.setSaveStpInterfaceTable(((java.lang.Boolean) value).booleanValue());
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("boolean");
    desc.setHandler(handler);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _saveStpInterfaceTable
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
      fieldValidator.setValidator(typeValidator);
    }
    desc.setValidator(fieldValidator);
    // -- _forceIpRouteDiscoveryOnEthernet
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Boolean.TYPE,
            "_forceIpRouteDiscoveryOnEthernet",
            "force-ip-route-discovery-on-ethernet",
            org.exolab.castor.xml.NodeType.Attribute);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Package target = (Package) object;
            if (!target.hasForceIpRouteDiscoveryOnEthernet()) {
              return null;
            }
            return (target.getForceIpRouteDiscoveryOnEthernet()
                ? java.lang.Boolean.TRUE
                : java.lang.Boolean.FALSE);
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteForceIpRouteDiscoveryOnEthernet();
                return;
              }
              target.setForceIpRouteDiscoveryOnEthernet(((java.lang.Boolean) value).booleanValue());
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("boolean");
    desc.setHandler(handler);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _forceIpRouteDiscoveryOnEthernet
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
      fieldValidator.setValidator(typeValidator);
    }
    desc.setValidator(fieldValidator);
    // -- initialize element descriptors

    // -- _filter
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            org.opennms.netmgt.config.linkd.Filter.class,
            "_filter",
            "filter",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Package target = (Package) object;
            return target.getFilter();
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              target.setFilter((org.opennms.netmgt.config.linkd.Filter) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return new org.opennms.netmgt.config.linkd.Filter();
          }
        };
    desc.setSchemaType("org.opennms.netmgt.config.linkd.Filter");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/config/linkd");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _filter
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
    // -- _specificList
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class,
            "_specificList",
            "specific",
            org.exolab.castor.xml.NodeType.Element);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Package target = (Package) object;
            return target.getSpecific();
          }

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

          public void resetValue(Object object)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              target.removeAllSpecific();
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/config/linkd");
    desc.setMultivalued(true);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _specificList
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(0);
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    // -- _includeRangeList
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            org.opennms.netmgt.config.linkd.IncludeRange.class,
            "_includeRangeList",
            "include-range",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Package target = (Package) object;
            return target.getIncludeRange();
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              target.addIncludeRange((org.opennms.netmgt.config.linkd.IncludeRange) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public void resetValue(Object object)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              target.removeAllIncludeRange();
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return new org.opennms.netmgt.config.linkd.IncludeRange();
          }
        };
    desc.setSchemaType("org.opennms.netmgt.config.linkd.IncludeRange");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/config/linkd");
    desc.setMultivalued(true);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _includeRangeList
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(0);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
    // -- _excludeRangeList
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            org.opennms.netmgt.config.linkd.ExcludeRange.class,
            "_excludeRangeList",
            "exclude-range",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Package target = (Package) object;
            return target.getExcludeRange();
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              target.addExcludeRange((org.opennms.netmgt.config.linkd.ExcludeRange) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public void resetValue(Object object)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              target.removeAllExcludeRange();
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return new org.opennms.netmgt.config.linkd.ExcludeRange();
          }
        };
    desc.setSchemaType("org.opennms.netmgt.config.linkd.ExcludeRange");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/config/linkd");
    desc.setMultivalued(true);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _excludeRangeList
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(0);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
    // -- _includeUrlList
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class,
            "_includeUrlList",
            "include-url",
            org.exolab.castor.xml.NodeType.Element);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Package target = (Package) object;
            return target.getIncludeUrl();
          }

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

          public void resetValue(Object object)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Package target = (Package) object;
              target.removeAllIncludeUrl();
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/config/linkd");
    desc.setMultivalued(true);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _includeUrlList
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(0);
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
  }
Exemplo n.º 19
0
  public MetadataTypeDescriptor() {
    super();
    _nsURI = "http://www.topografix.com/GPX/1/1";
    _xmlName = "metadataType";
    _elementDefinition = false;

    // -- set grouping compositor
    setCompositorAsSequence();
    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    org.exolab.castor.mapping.FieldHandler handler = null;
    org.exolab.castor.xml.FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- initialize element descriptors

    // -- _name
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Element);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            MetadataType target = (MetadataType) object;
            return target.getName();
          }

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

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://www.topografix.com/GPX/1/1");
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _name
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    // -- _desc
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class, "_desc", "desc", org.exolab.castor.xml.NodeType.Element);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            MetadataType target = (MetadataType) object;
            return target.getDesc();
          }

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

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://www.topografix.com/GPX/1/1");
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _desc
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    // -- _author
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            net.sourceforge.gpstools.gpx.Author.class,
            "_author",
            "author",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            MetadataType target = (MetadataType) object;
            return target.getAuthor();
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              MetadataType target = (MetadataType) object;
              target.setAuthor((net.sourceforge.gpstools.gpx.Author) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("net.sourceforge.gpstools.gpx.Author");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://www.topografix.com/GPX/1/1");
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _author
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
    // -- _copyright
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            net.sourceforge.gpstools.gpx.Copyright.class,
            "_copyright",
            "copyright",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            MetadataType target = (MetadataType) object;
            return target.getCopyright();
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              MetadataType target = (MetadataType) object;
              target.setCopyright((net.sourceforge.gpstools.gpx.Copyright) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("net.sourceforge.gpstools.gpx.Copyright");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://www.topografix.com/GPX/1/1");
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _copyright
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
    // -- _metadataLinkList
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            net.sourceforge.gpstools.gpx.MetadataLink.class,
            "_metadataLinkList",
            "link",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            MetadataType target = (MetadataType) object;
            return target.getMetadataLink();
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              MetadataType target = (MetadataType) object;
              target.addMetadataLink((net.sourceforge.gpstools.gpx.MetadataLink) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public void resetValue(Object object)
              throws IllegalStateException, IllegalArgumentException {
            try {
              MetadataType target = (MetadataType) object;
              target.removeAllMetadataLink();
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("net.sourceforge.gpstools.gpx.MetadataLink");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://www.topografix.com/GPX/1/1");
    desc.setMultivalued(true);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _metadataLinkList
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(0);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
    // -- _time
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.util.Date.class, "_time", "time", org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            MetadataType target = (MetadataType) object;
            return target.getTime();
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              MetadataType target = (MetadataType) object;
              target.setTime((java.util.Date) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return new java.util.Date();
          }
        };
    handler = new org.exolab.castor.xml.handlers.DateFieldHandler(handler);
    desc.setImmutable(true);
    desc.setSchemaType("dateTime");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://www.topografix.com/GPX/1/1");
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _time
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.DateTimeValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.DateTimeValidator();
      fieldValidator.setValidator(typeValidator);
    }
    desc.setValidator(fieldValidator);
    // -- _keywords
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class,
            "_keywords",
            "keywords",
            org.exolab.castor.xml.NodeType.Element);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            MetadataType target = (MetadataType) object;
            return target.getKeywords();
          }

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

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://www.topografix.com/GPX/1/1");
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _keywords
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    // -- _bounds
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            net.sourceforge.gpstools.gpx.Bounds.class,
            "_bounds",
            "bounds",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            MetadataType target = (MetadataType) object;
            return target.getBounds();
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              MetadataType target = (MetadataType) object;
              target.setBounds((net.sourceforge.gpstools.gpx.Bounds) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("net.sourceforge.gpstools.gpx.Bounds");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://www.topografix.com/GPX/1/1");
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _bounds
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
    // -- _metadataExtensions
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            net.sourceforge.gpstools.gpx.MetadataExtensions.class,
            "_metadataExtensions",
            "extensions",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            MetadataType target = (MetadataType) object;
            return target.getMetadataExtensions();
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              MetadataType target = (MetadataType) object;
              target.setMetadataExtensions((net.sourceforge.gpstools.gpx.MetadataExtensions) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("net.sourceforge.gpstools.gpx.MetadataExtensions");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://www.topografix.com/GPX/1/1");
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _metadataExtensions
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
  }
Exemplo n.º 20
0
  public CategoryDescriptor() {
    super();
    _nsURI = "http://xmlns.opennms.org/xsd/rtceui";
    _xmlName = "category";
    _elementDefinition = true;

    // -- set grouping compositor
    setCompositorAsSequence();
    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    org.exolab.castor.mapping.FieldHandler handler = null;
    org.exolab.castor.xml.FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- initialize element descriptors

    // -- _catlabel
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class,
            "_catlabel",
            "catlabel",
            org.exolab.castor.xml.NodeType.Element);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Category target = (Category) object;
            return target.getCatlabel();
          }

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

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/rtceui");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _catlabel
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    // -- _catvalue
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Double.TYPE, "_catvalue", "catvalue", org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Category target = (Category) object;
            if (!target.hasCatvalue()) {
              return null;
            }
            return new java.lang.Double(target.getCatvalue());
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Category target = (Category) object;
              // ignore null values for non optional primitives
              if (value == null) {
                return;
              }

              target.setCatvalue(((java.lang.Double) value).doubleValue());
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("double");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/rtceui");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _catvalue
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      org.exolab.castor.xml.validators.DoubleValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.DoubleValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setMinInclusive(-1.7976931348623157E308);
      typeValidator.setMaxInclusive(1.7976931348623157E308);
    }
    desc.setValidator(fieldValidator);
    // -- _nodeList
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            org.opennms.netmgt.xml.rtc.Node.class,
            "_nodeList",
            "node",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            Category target = (Category) object;
            return target.getNode();
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Category target = (Category) object;
              target.addNode((org.opennms.netmgt.xml.rtc.Node) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public void resetValue(Object object)
              throws IllegalStateException, IllegalArgumentException {
            try {
              Category target = (Category) object;
              target.removeAllNode();
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return new org.opennms.netmgt.xml.rtc.Node();
          }
        };
    desc.setSchemaType("org.opennms.netmgt.xml.rtc.Node");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/rtceui");
    desc.setMultivalued(true);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _nodeList
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(0);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
  }
  public NsclientCollectionDescriptor() {
    super();
    _nsURI = "http://xmlns.opennms.org/xsd/config/nsclient-datacollection";
    _xmlName = "nsclient-collection";
    _elementDefinition = true;

    // -- set grouping compositor
    setCompositorAsSequence();
    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    org.exolab.castor.mapping.FieldHandler handler = null;
    org.exolab.castor.xml.FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- _name
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            NsclientCollection target = (NsclientCollection) object;
            return target.getName();
          }

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

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _name
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    // -- initialize element descriptors

    // -- _rrd
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            org.opennms.netmgt.config.nsclient.Rrd.class,
            "_rrd",
            "rrd",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            NsclientCollection target = (NsclientCollection) object;
            return target.getRrd();
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              NsclientCollection target = (NsclientCollection) object;
              target.setRrd((org.opennms.netmgt.config.nsclient.Rrd) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return new org.opennms.netmgt.config.nsclient.Rrd();
          }
        };
    desc.setSchemaType("org.opennms.netmgt.config.nsclient.Rrd");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/config/nsclient-datacollection");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _rrd
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
    // -- _wpms
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            org.opennms.netmgt.config.nsclient.Wpms.class,
            "_wpms",
            "wpms",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            NsclientCollection target = (NsclientCollection) object;
            return target.getWpms();
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              NsclientCollection target = (NsclientCollection) object;
              target.setWpms((org.opennms.netmgt.config.nsclient.Wpms) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return new org.opennms.netmgt.config.nsclient.Wpms();
          }
        };
    desc.setSchemaType("org.opennms.netmgt.config.nsclient.Wpms");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/config/nsclient-datacollection");
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _wpms
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
  }
  public NsclientConfigDescriptor() {
    super();
    _nsURI = "http://xmlns.opennms.org/xsd/config/nsclient";
    _xmlName = "nsclient-config";
    _elementDefinition = true;

    // -- set grouping compositor
    setCompositorAsSequence();
    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
    org.exolab.castor.mapping.FieldHandler handler = null;
    org.exolab.castor.xml.FieldValidator fieldValidator = null;
    // -- initialize attribute descriptors

    // -- _port
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Integer.TYPE, "_port", "port", org.exolab.castor.xml.NodeType.Attribute);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            NsclientConfig target = (NsclientConfig) object;
            if (!target.hasPort()) {
              return null;
            }
            return new java.lang.Integer(target.getPort());
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              NsclientConfig target = (NsclientConfig) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deletePort();
                return;
              }
              target.setPort(((java.lang.Integer) value).intValue());
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("int");
    desc.setHandler(handler);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _port
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.IntValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setMinInclusive(-2147483648);
      typeValidator.setMaxInclusive(2147483647);
    }
    desc.setValidator(fieldValidator);
    // -- _retry
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Integer.TYPE, "_retry", "retry", org.exolab.castor.xml.NodeType.Attribute);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            NsclientConfig target = (NsclientConfig) object;
            if (!target.hasRetry()) {
              return null;
            }
            return new java.lang.Integer(target.getRetry());
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              NsclientConfig target = (NsclientConfig) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteRetry();
                return;
              }
              target.setRetry(((java.lang.Integer) value).intValue());
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("int");
    desc.setHandler(handler);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _retry
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.IntValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setMinInclusive(-2147483648);
      typeValidator.setMaxInclusive(2147483647);
    }
    desc.setValidator(fieldValidator);
    // -- _timeout
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.Integer.TYPE,
            "_timeout",
            "timeout",
            org.exolab.castor.xml.NodeType.Attribute);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            NsclientConfig target = (NsclientConfig) object;
            if (!target.hasTimeout()) {
              return null;
            }
            return new java.lang.Integer(target.getTimeout());
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              NsclientConfig target = (NsclientConfig) object;
              // if null, use delete method for optional primitives
              if (value == null) {
                target.deleteTimeout();
                return;
              }
              target.setTimeout(((java.lang.Integer) value).intValue());
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("int");
    desc.setHandler(handler);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _timeout
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.IntValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setMinInclusive(-2147483648);
      typeValidator.setMaxInclusive(2147483647);
    }
    desc.setValidator(fieldValidator);
    // -- _password
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            java.lang.String.class,
            "_password",
            "password",
            org.exolab.castor.xml.NodeType.Attribute);
    desc.setImmutable(true);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            NsclientConfig target = (NsclientConfig) object;
            return target.getPassword();
          }

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

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return null;
          }
        };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    // -- validation code for: _password
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { // -- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    // -- initialize element descriptors

    // -- _definitionList
    desc =
        new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
            org.opennms.netmgt.config.nsclient.Definition.class,
            "_definitionList",
            "definition",
            org.exolab.castor.xml.NodeType.Element);
    handler =
        new org.exolab.castor.xml.XMLFieldHandler() {
          @Override
          public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException {
            NsclientConfig target = (NsclientConfig) object;
            return target.getDefinition();
          }

          @Override
          public void setValue(java.lang.Object object, java.lang.Object value)
              throws IllegalStateException, IllegalArgumentException {
            try {
              NsclientConfig target = (NsclientConfig) object;
              target.addDefinition((org.opennms.netmgt.config.nsclient.Definition) value);
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          public void resetValue(Object object)
              throws IllegalStateException, IllegalArgumentException {
            try {
              NsclientConfig target = (NsclientConfig) object;
              target.removeAllDefinition();
            } catch (java.lang.Exception ex) {
              throw new IllegalStateException(ex.toString());
            }
          }

          @Override
          @SuppressWarnings("unused")
          public java.lang.Object newInstance(java.lang.Object parent) {
            return new org.opennms.netmgt.config.nsclient.Definition();
          }
        };
    desc.setSchemaType("org.opennms.netmgt.config.nsclient.Definition");
    desc.setHandler(handler);
    desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/config/nsclient");
    desc.setMultivalued(true);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    // -- validation code for: _definitionList
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(0);
    { // -- local scope
    }
    desc.setValidator(fieldValidator);
  }