final DocumentRequestCreateBean documentRequestCreateBean = new DocumentRequestCreateBean();
final DocumentRequestCreateBean documentRequestCreateBean = new DocumentRequestCreateBean(null);
    private DocumentRequestCreateBean buildDocumentRequestCreateBean(            final DynaActionForm dynaActionForm, final StudentCurricularPlan studentCurricularPlan,            final DocumentPurposeType chosenDocumentPurposeType, final String otherPurpose,            final String notes, final Boolean urgentRequest,            final DocumentRequestType documentRequestType) {        final DocumentRequestCreateBean documentRequestCreateBean = new DocumentRequestCreateBean();        documentRequestCreateBean.setToBeCreated(Boolean.TRUE);        documentRequestCreateBean.setStudentCurricularPlan(studentCurricularPlan);        documentRequestCreateBean.setChosenDocumentRequestType(documentRequestType);        documentRequestCreateBean.setChosenDocumentPurposeType(chosenDocumentPurposeType);        documentRequestCreateBean.setOtherPurpose(otherPurpose);        documentRequestCreateBean.setNotes(notes);        documentRequestCreateBean.setUrgentRequest(urgentRequest);        final Boolean average;        final Boolean detailed;        final ExecutionYear executionYear;        if (documentRequestType == DocumentRequestType.SCHOOL_REGISTRATION_CERTIFICATE) {            average = null;            detailed = null;            Integer executionYearId = (Integer) dynaActionForm.get("schoolRegistrationExecutionYearId");            executionYear = rootDomainObject.readExecutionYearByOID(executionYearId);        } else if (documentRequestType == DocumentRequestType.ENROLMENT_CERTIFICATE) {            average = null;            detailed = Boolean.valueOf(dynaActionForm.getString("enrolmentDetailed"));            Integer executionYearId = (Integer) dynaActionForm.get("enrolmentExecutionYearId");            executionYear = rootDomainObject.readExecutionYearByOID(executionYearId);        } else if (documentRequestType == DocumentRequestType.DEGREE_FINALIZATION_CERTIFICATE) {            average = Boolean.valueOf(dynaActionForm.getString("degreeFinalizationAverage"));            detailed = Boolean.valueOf(dynaActionForm.getString("degreeFinalizationDetailed"));            executionYear = null;        } else {            average = null;            executionYear = null;            detailed = null;        }        documentRequestCreateBean.setAverage(average);        documentRequestCreateBean.setDetailed(detailed);        documentRequestCreateBean.setExecutionYear(executionYear);                if (documentRequestCreateBean.hasWarningsToReport()) {            warningsToReport.addAll(documentRequestCreateBean.getWarningsToReport());        }        return documentRequestCreateBean;    }