Exemple #1
0
  public HomeFolderType modelToXml() {

    HomeFolderType homeFolderType = HomeFolderType.Factory.newInstance();
    if (this.id != null) homeFolderType.setId(this.id.longValue());
    if (this.adress != null) homeFolderType.setAddress(Address.modelToXml(this.adress));

    IndividualType[] individualsArray = new IndividualType[individuals.size()];
    int i = 0;
    for (Individual individual : individuals) {
      if (individual instanceof Adult) {
        Adult adult = (Adult) individual;
        individualsArray[i] = Adult.modelToXml(adult);
      } else if (individual instanceof Child) {
        Child child = (Child) individual;
        individualsArray[i] = Child.modelToXml(child);
      }
      i++;
    }
    homeFolderType.setIndividualsArray(individualsArray);

    if (this.state != null)
      homeFolderType.setState(
          fr.cg95.cvq.xml.common.ActorStateType.Enum.forString(this.state.toString()));
    if (this.familyQuotient != null) homeFolderType.setFamilyQuotient(this.familyQuotient);

    return homeFolderType;
  }
  @Override
  public final CompostableWasteCollectionRequestDocument modelToXml() {

    Calendar calendar = Calendar.getInstance();
    LocalTime localTime = new LocalTime();
    Date date = null;
    CompostableWasteCollectionRequestDocument compostableWasteCollectionRequestDoc =
        CompostableWasteCollectionRequestDocument.Factory.newInstance();
    CompostableWasteCollectionRequestDocument.CompostableWasteCollectionRequest
        compostableWasteCollectionRequest =
            compostableWasteCollectionRequestDoc.addNewCompostableWasteCollectionRequest();
    super.fillCommonXmlInfo(compostableWasteCollectionRequest);
    int i = 0;

    if (getCollectionAddress() != null)
      compostableWasteCollectionRequest.setCollectionAddress(
          Address.modelToXml(getCollectionAddress()));

    i = 0;
    if (getCompostableWasteType() != null) {
      fr.cg95.cvq.xml.common.LocalReferentialDataType[] compostableWasteTypeTypeTab =
          new fr.cg95.cvq.xml.common.LocalReferentialDataType[getCompostableWasteType().size()];
      for (LocalReferentialData object : getCompostableWasteType()) {
        compostableWasteTypeTypeTab[i++] = LocalReferentialData.modelToXml(object);
      }
      compostableWasteCollectionRequest.setCompostableWasteTypeArray(compostableWasteTypeTypeTab);
    }

    compostableWasteCollectionRequest.setOtherWaste(getOtherWaste());

    return compostableWasteCollectionRequestDoc;
  }
  @Override
  public final TechnicalInterventionRequestDocument modelToXml() {

    Calendar calendar = Calendar.getInstance();
    LocalTime localTime = new LocalTime();
    Date date = null;
    TechnicalInterventionRequestDocument technicalInterventionRequestDoc =
        TechnicalInterventionRequestDocument.Factory.newInstance();
    TechnicalInterventionRequestDocument.TechnicalInterventionRequest technicalInterventionRequest =
        technicalInterventionRequestDoc.addNewTechnicalInterventionRequest();
    super.fillCommonXmlInfo(technicalInterventionRequest);
    int i = 0;

    technicalInterventionRequest.setInterventionDescription(getInterventionDescription());

    if (getInterventionPlace() != null)
      technicalInterventionRequest.setInterventionPlace(Address.modelToXml(getInterventionPlace()));

    i = 0;
    if (getInterventionType() != null) {
      fr.cg95.cvq.xml.common.LocalReferentialDataType[] interventionTypeTypeTab =
          new fr.cg95.cvq.xml.common.LocalReferentialDataType[getInterventionType().size()];
      for (LocalReferentialData object : getInterventionType()) {
        interventionTypeTypeTab[i++] = LocalReferentialData.modelToXml(object);
      }
      technicalInterventionRequest.setInterventionTypeArray(interventionTypeTypeTab);
    }

    technicalInterventionRequest.setOtherInterventionLabel(getOtherInterventionLabel());

    return technicalInterventionRequestDoc;
  }
  @Override
  public final AlignmentCertificateRequestDocument modelToXml() {

    Calendar calendar = Calendar.getInstance();
    LocalTime localTime = new LocalTime();
    Date date = null;
    AlignmentCertificateRequestDocument alignmentCertificateRequestDoc =
        AlignmentCertificateRequestDocument.Factory.newInstance();
    AlignmentCertificateRequestDocument.AlignmentCertificateRequest alignmentCertificateRequest =
        alignmentCertificateRequestDoc.addNewAlignmentCertificateRequest();
    super.fillCommonXmlInfo(alignmentCertificateRequest);
    int i = 0;

    if (getRequesterQuality() != null)
      alignmentCertificateRequest.setRequesterQuality(
          fr.cg95.cvq.xml.request.urbanism.AcrRequesterQualityType.Enum.forString(
              getRequesterQuality().toString()));

    alignmentCertificateRequest.setSection(getSection());

    alignmentCertificateRequest.setTransportationRoute(getTransportationRoute());

    alignmentCertificateRequest.setOwnerFirstNames(getOwnerFirstNames());

    alignmentCertificateRequest.setLocality(getLocality());

    if (getNumber() != null)
      alignmentCertificateRequest.setNumber(new BigInteger(getNumber().toString()));

    alignmentCertificateRequest.setOwnerLastName(getOwnerLastName());

    if (getOwnerAddress() != null)
      alignmentCertificateRequest.setOwnerAddress(Address.modelToXml(getOwnerAddress()));

    return alignmentCertificateRequestDoc;
  }