Package net.sf.esims.exception

Examples of net.sf.esims.exception.BusinessRuleException


  }


  public void setGrossHouseHoldIncome(Float grossHouseHoldIncome) {
    if(grossHouseHoldIncome == null)
      throw new BusinessRuleException("The household income cannot be null");
    if( (grossHouseHoldIncome.floatValue()==0 || grossHouseHoldIncome.floatValue()<0))
      throw new BusinessRuleException("The household income cannot be -ve or 0");
    this.grossHouseHoldIncome = grossHouseHoldIncome;
  }
View Full Code Here


  }


  public void setOtherBackwardCaste(Boolean otherBackwardCaste) {
    if(otherBackwardCaste == null)
      throw new BusinessRuleException("OBC cannot be null");
    this.otherBackwardCaste = otherBackwardCaste;
  }
View Full Code Here

  }


  public void setScheduledCasteOrTribe(Boolean scheduledCasteOrTribe) {
    if(scheduledCasteOrTribe == null)
      throw new BusinessRuleException("SCST option cannot be null");
    this.scheduledCasteOrTribe = scheduledCasteOrTribe;
  }
View Full Code Here

    Calendar today = Calendar.getInstance();
    int currentYear = today.get(Calendar.YEAR);
    int applicantBirthYear;
   
    if(this.academicYear == null || this.academicYear.getAcademicYearId()==null)
      throw new BusinessRuleException("The academic year cannot be empty/null");
    EsimsUtils.validateStrings(this.formNumber,32);
   
    if(this.formIssuedOn == null)
      throw new BusinessRuleException("The date of issuance of the form cannot be null");
    if(this.formFilledOn == null)
      throw new BusinessRuleException("The date of issuance of the form cannot be null");
    if(this.formReceivedOn == null)
      throw new BusinessRuleException("The date of receving the form cannot be null");
   
    /*moved the date validations to the UI ot prevent hte data migration tool from failing.
     *the data migration toll will be handling historical data, so we should be able to
     * provide dates in the previous periods also
     */
   
    EsimsUtils.validateStrings(this.firstName, 32);
   
    EsimsUtils.validateStrings(this.lastName, 32);
     
   
    if(this.dateOfBirth == null)
      throw new BusinessRuleException("The date of birth of the applicant cannot be empty");
     
    EsimsUtils.validateStrings(this.placeOfBirth, 32);
   
       
    if(StringUtils.isEmpty(this.gender))
      throw new BusinessRuleException("The gender of the applicant  cannot be empty/null");
    if(this.gender.length() > 1)
      throw new BusinessRuleException("The gender of the applicant cannot exced 1 charcter");
    if(! (this.gender.equalsIgnoreCase("m")|| this.gender.equalsIgnoreCase("f")) )
      throw new BusinessRuleException("The gender of the applicant can be only M/F");
   
    EsimsUtils.validateStrings(nationality, 32);
   
    EsimsUtils.validateStrings(motherTounge, 32);

    EsimsUtils.validateStrings(religion, 32);
   
    EsimsUtils.validateNullableStrings(caste, 32);
   
    EsimsUtils.validateNullableStrings(subcaste, 32);
   
   
    if(this.scheduledCasteOrTribe ==null)
        throw new BusinessRuleException("You must specify if the applicant is a scheduled cast or not");
   
    if(this.otherBackwardCaste ==null)
      throw new BusinessRuleException("You must specify if the applicant is an OBC candidate or not");
    if( (this.scheduledCasteOrTribe == Boolean.TRUE && this.otherBackwardCaste == Boolean.TRUE ) )
      throw new BusinessRuleException("A candidate cant be SCST and OBC at the same time");
   
   
    EsimsUtils.validateStrings(this.fatherFirstName, 32);
     
    EsimsUtils.validateNullableStrings(this.fatherMiddleName, 32);
   
    EsimsUtils.validateStrings(this.fatherLastName, 32);
   
    EsimsUtils.validateStrings(this.motherFirstName, 32);
   
    EsimsUtils.validateNullableStrings(this.motherMiddleName, 32);
   
    EsimsUtils.validateStrings(this.motherLastName, 32);
         
    EsimsUtils.validateStrings(this.permanentHouseNameOrNumber, 32);
   
    EsimsUtils.validateStrings(this.motherLastName, 32);   
   
    EsimsUtils.validateStrings(this.permanentStreet, 32);
   
    EsimsUtils.validateStrings(this.permanentVillageOrTownOrCity, 32);
       
    EsimsUtils.validateStrings(this.permanentState, 32);
   
    EsimsUtils.validateStrings(this.permanentPinCode, 6);
   
    EsimsUtils.validateNullableStrings(this.permanentPhoneNumber, 15);
   
   
    if( (grossHouseHoldIncome == null || grossHouseHoldIncome.floatValue()<= 0.0f) )
      throw new BusinessRuleException("The Gross house hold income cannot be null , negative or 0");
   
   
    if(belowPovertyLine == null)
      throw new BusinessRuleException("It must be indicated if the applicant is below the poverty line or not");
   
    EsimsUtils.validateNullableStrings(this.previousSchoolIfAny, 64);
   
       
   
View Full Code Here

    this.entranceExam = entranceExam;
  }

  public void setSchool(School school) {
    if (school == null)
      throw new BusinessRuleException(
          "The school linked to the Academic year cannot be null/ empty");
    if (school.getSchoolId() == null)
      throw new BusinessRuleException(
          "The subjectId of the school linked to the Academic year cannot be null/ empty");
    this.school = school;
  }
View Full Code Here

  public void setStatus(String status) {
    EsimsUtils.validateStrings(status, 7);
    if (!(status.equalsIgnoreCase("ACTIVE") || status
        .equalsIgnoreCase("HISTORY")))
      throw new BusinessRuleException(
          "The status for an Academic year must be 'ACTIVE'/ HISTORY'");
    this.status = status;
  }
View Full Code Here

    return startDate;
  }

  public void setDescription(String description) {
    if (description == null || description.length()==0)
      throw new BusinessRuleException("The description for the exam cannot be null/empty");
    this.description = description;
  }
View Full Code Here

    this.description = description;
  }

  public void setEndDate(Date endDate) {
    if (endDate == null)
      throw new BusinessRuleException(
          "The end date for the Exam cannot be null");
    this.endDate = endDate;
  }
View Full Code Here

    this.examId = examId;
  }

  public void setAcademicYear(AcademicYear academicYear) {
    if (academicYear == null)
      throw new BusinessRuleException(
          "The academic year associated with an Exam cannot be null");
    if (academicYear.getAcademicYearId() == null)
      throw new BusinessRuleException(
          "The academic year associated with an Exam cannot have a null ID");
    this.academicYear = academicYear;
  }
View Full Code Here

    this.academicYear = academicYear;
  }

  public void setStartDate(Date startDate) {
    if (startDate == null)
      throw new BusinessRuleException(
          "The start date for the Exam cannot be null");
    this.startDate = startDate;
  }
View Full Code Here

TOP

Related Classes of net.sf.esims.exception.BusinessRuleException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.