Esempio n. 1
0
  public static DeathDetailsRequest xmlToModel(DeathDetailsRequestDocument deathDetailsRequestDoc) {
    DeathDetailsRequestDocument.DeathDetailsRequest deathDetailsRequestXml =
        deathDetailsRequestDoc.getDeathDetailsRequest();
    Calendar calendar = Calendar.getInstance();
    LocalTime localTime = new LocalTime();
    List list = new ArrayList();
    DeathDetailsRequest deathDetailsRequest = new DeathDetailsRequest();
    deathDetailsRequest.fillCommonModelInfo(deathDetailsRequest, deathDetailsRequestXml);

    deathDetailsRequest.setComment(deathDetailsRequestXml.getComment());

    deathDetailsRequest.setCopies(deathDetailsRequestXml.getCopies());

    deathDetailsRequest.setDeathCity(deathDetailsRequestXml.getDeathCity());

    calendar = deathDetailsRequestXml.getDeathDate();
    if (calendar != null) {
      deathDetailsRequest.setDeathDate(calendar.getTime());
    }

    deathDetailsRequest.setDeathFirstNames(deathDetailsRequestXml.getDeathFirstNames());

    deathDetailsRequest.setDeathLastName(deathDetailsRequestXml.getDeathLastName());

    deathDetailsRequest.setDeathPostalCode(deathDetailsRequestXml.getDeathPostalCode());

    if (deathDetailsRequestXml.getFormat() != null)
      deathDetailsRequest.setFormat(
          fr.cg95.cvq.business.request.civil.DeathCertificateFormatType.forString(
              deathDetailsRequestXml.getFormat().toString()));
    else
      deathDetailsRequest.setFormat(
          fr.cg95.cvq.business.request.civil.DeathCertificateFormatType
              .getDefaultDeathCertificateFormatType());

    if (deathDetailsRequestXml.getMotive() != null)
      deathDetailsRequest.setMotive(
          fr.cg95.cvq.business.request.civil.DeathCertificateMotiveType.forString(
              deathDetailsRequestXml.getMotive().toString()));
    else
      deathDetailsRequest.setMotive(
          fr.cg95.cvq.business.request.civil.DeathCertificateMotiveType
              .getDefaultDeathCertificateMotiveType());

    return deathDetailsRequest;
  }