コード例 #1
0
  @Override
  public DeathDetailsRequest clone() {
    DeathDetailsRequest clone =
        new DeathDetailsRequest(getRequestData().clone(), deathDetailsRequestData.clone());
    Map<String, Object> stepState;

    stepState = new HashMap<String, Object>(4);
    stepState.put("state", "uncomplete");
    stepState.put("required", true);
    stepState.put("errorMsg", null);
    stepState.put("invalidFields", new ArrayList<String>());
    clone.getStepStates().put("nature", stepState);

    stepState = new HashMap<String, Object>(4);
    stepState.put("state", "unavailable");
    stepState.put("required", true);
    stepState.put("errorMsg", null);
    stepState.put("invalidFields", new ArrayList<String>());
    clone.getStepStates().put("type", stepState);

    stepState = new HashMap<String, Object>(4);
    stepState.put("state", "unavailable");
    stepState.put("required", false);
    stepState.put("errorMsg", null);
    stepState.put("invalidFields", new ArrayList<String>());
    clone.getStepStates().put("document", stepState);

    stepState = new HashMap<String, Object>(4);
    stepState.put("state", "unavailable");
    stepState.put("required", true);
    stepState.put("errorMsg", null);
    stepState.put("invalidFields", new ArrayList<String>());
    clone.getStepStates().put("validation", stepState);

    return clone;
  }
コード例 #2
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;
  }