org.kuali.kpme.core.util
Class ValidationUtils

java.lang.Object
  extended by org.kuali.kpme.core.util.ValidationUtils

public class ValidationUtils
extends Object

A few methods to assist with various validation tasks.


Constructor Summary
ValidationUtils()
           
 
Method Summary
static boolean duplicateDeptEarnCodeExists(EarnCodeSecurity deptEarnCode)
           
static boolean earnGroupHasOvertimeEarnCodes(String earnGroup, org.joda.time.LocalDate asOfDate)
           
static boolean isWildCard(String aString)
           
static boolean validateAccCategory(String accrualCategory, org.joda.time.LocalDate asOfDate)
           
static boolean validateAccCategory(String accrualCategory, String principalId, org.joda.time.LocalDate asOfDate)
           
static boolean validateAccount(String chartOfAccountsCode, String accountNumber)
          validates an open account exists matching the chart of accounts and account number.
static boolean validateAccrualCategory(String accrualCategory)
          Most basic validation: Only checks for presence in the database.
static boolean validateAccrualCategory(String accrualCategory, org.joda.time.LocalDate asOfDate)
          Checks for row presence of a Accrual Category, and optionally whether or not it is active as of the specified date.
static boolean validateCalendar(String calendarName)
          Checks for row presence of a pay calendar
static boolean validateCalendarByType(String calendarName, String calendarType)
          Checks for row presence of a pay calendar by calendar type
static boolean validateCampus(String campusCode)
           
static boolean validateChart(String chart)
          Check for row existence of the specified chart and also, if found, that the chart is active.
static boolean validateDepartment(String department)
          Most basic validation: Only checks for presence in the database.
static boolean validateDepartment(String department, org.joda.time.LocalDate asOfDate)
          Checks for row presence of a department, and optionally whether or not it is active as of the specified date.
static boolean validateEarnCode(String earnCode, boolean otEarnCode, org.joda.time.LocalDate asOfDate)
           
static boolean validateEarnCode(String earnCode, org.joda.time.LocalDate asOfDate)
           
static boolean validateEarnCodeFraction(String earnCode, BigDecimal amount, org.joda.time.LocalDate asOfDate)
           
static boolean validateEarnCodeOfAccrualCategory(String earnCode, String accrualCategory, org.joda.time.LocalDate asOfDate)
           
static boolean validateEarnGroup(String earnGroup, org.joda.time.LocalDate asOfDate)
          No wildcarding is accounted for in this method.
static boolean validateFutureDate(org.joda.time.LocalDate date)
          Checks for date in the future
static boolean validateInstitution(String institutionCode, org.joda.time.LocalDate asOfDate)
           
static boolean validateLeavePlan(String leavePlan, org.joda.time.LocalDate asOfDate)
           
static boolean validateLocation(String location, org.joda.time.LocalDate asOfDate)
           
static boolean validateLocationWithSalaryGroup(String salaryGroup, String location, org.joda.time.LocalDate asOfDate)
          validates location against location of salary group
static boolean validateObjectCode(String financialObjectCode, String chartOfAccountsCode, Integer universityFiscalYear)
          validates an active object code exists matching the supplied params.
static boolean validateOneYearFutureDate(org.joda.time.LocalDate date)
          Checks for date not more than one year in the future or current date
static boolean validateOneYearFutureEffectiveDate(org.joda.time.LocalDate date)
          Checks for date not more than one year in the future and does not consider past date
static boolean validateOrganization(String organizationCode, String chartOfAccountsCode)
          validates an active organization matching organizationCode exists, whose chart of accounts code is chartOfAccountsCode
static boolean validatePayGrade(String payGrade, String salGroup, org.joda.time.LocalDate asOfDate)
           
static boolean validatePayGradeWithSalaryGroup(String salaryGroup, String payGrade, org.joda.time.LocalDate asOfDate)
           
static boolean validatePayType(String payType, org.joda.time.LocalDate asOfDate)
           
static boolean validatePrincipalId(String principalId)
          Checks for row presence of a principal Id, and optionally whether or not it is active as of the specified date.
static boolean validateRecordMethod(String recordMethod, String accrualCategory, org.joda.time.LocalDate asOfDate)
           
static boolean validateSalGroup(String salGroup, org.joda.time.LocalDate asOfDate)
           
static boolean validateSubAccount(String subAccountNumber, String accountNumber, String chartOfAccountsCode)
          validates existence of an active sub account matching the supplied params.
static boolean validateSubObjectCode(String universityFiscalYear, String chartOfAccountsCode, String accountNumber, String financialObjectCode, String financialSubObjectCode)
          validates active sub object code existence matching the supplied params.
static boolean validateTask(Long task, org.joda.time.LocalDate asOfDate)
          No wildcarding is accounted for in this method.
static boolean validateWorkArea(Long workArea)
          Most basic validation: Only checks for presence in the database.
static boolean validateWorkArea(Long workArea, org.joda.time.LocalDate asOfDate)
          Checks for row presence of a work area, and optionally whether or not it is active as of the specified date.
static boolean validateWorkArea(Long workArea, String dept, org.joda.time.LocalDate asOfDate)
           
static boolean validateWorkAreaDeptWildcarding(DepartmentalRule dr)
          For DepartmentalRule objects, if a work area is defined, you can not leave the department field with a wildcard.
static boolean wildCardMatch(String string1, String string2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationUtils

public ValidationUtils()
Method Detail

validateWorkAreaDeptWildcarding

public static boolean validateWorkAreaDeptWildcarding(DepartmentalRule dr)
For DepartmentalRule objects, if a work area is defined, you can not leave the department field with a wildcard. Permission for wildcarding will be checked with other methods.

Parameters:
dr - The DepartmentalRule to examine.
Returns:
true if valid, false otherwise.

validateWorkArea

public static boolean validateWorkArea(Long workArea)
Most basic validation: Only checks for presence in the database.


validateDepartment

public static boolean validateDepartment(String department)
Most basic validation: Only checks for presence in the database.


validateAccrualCategory

public static boolean validateAccrualCategory(String accrualCategory)
Most basic validation: Only checks for presence in the database.


validateSalGroup

public static boolean validateSalGroup(String salGroup,
                                       org.joda.time.LocalDate asOfDate)

validateEarnCode

public static boolean validateEarnCode(String earnCode,
                                       org.joda.time.LocalDate asOfDate)

validateLeavePlan

public static boolean validateLeavePlan(String leavePlan,
                                        org.joda.time.LocalDate asOfDate)

validateEarnCodeOfAccrualCategory

public static boolean validateEarnCodeOfAccrualCategory(String earnCode,
                                                        String accrualCategory,
                                                        org.joda.time.LocalDate asOfDate)

validateAccCategory

public static boolean validateAccCategory(String accrualCategory,
                                          org.joda.time.LocalDate asOfDate)

validateAccCategory

public static boolean validateAccCategory(String accrualCategory,
                                          String principalId,
                                          org.joda.time.LocalDate asOfDate)

validateLocation

public static boolean validateLocation(String location,
                                       org.joda.time.LocalDate asOfDate)

validatePayType

public static boolean validatePayType(String payType,
                                      org.joda.time.LocalDate asOfDate)

validatePayGrade

public static boolean validatePayGrade(String payGrade,
                                       String salGroup,
                                       org.joda.time.LocalDate asOfDate)

validateEarnCode

public static boolean validateEarnCode(String earnCode,
                                       boolean otEarnCode,
                                       org.joda.time.LocalDate asOfDate)
Parameters:
earnCode -
otEarnCode - If true, earn code is valid ONLY if it is an overtime earn code.
asOfDate -
Returns:

validateDepartment

public static boolean validateDepartment(String department,
                                         org.joda.time.LocalDate asOfDate)
Checks for row presence of a department, and optionally whether or not it is active as of the specified date.


validateChart

public static boolean validateChart(String chart)
Check for row existence of the specified chart and also, if found, that the chart is active.

Parameters:
chart -
Returns:

validateWorkArea

public static boolean validateWorkArea(Long workArea,
                                       org.joda.time.LocalDate asOfDate)
Checks for row presence of a work area, and optionally whether or not it is active as of the specified date.


validateWorkArea

public static boolean validateWorkArea(Long workArea,
                                       String dept,
                                       org.joda.time.LocalDate asOfDate)

validateAccrualCategory

public static boolean validateAccrualCategory(String accrualCategory,
                                              org.joda.time.LocalDate asOfDate)
Checks for row presence of a Accrual Category, and optionally whether or not it is active as of the specified date.


validatePrincipalId

public static boolean validatePrincipalId(String principalId)
Checks for row presence of a principal Id, and optionally whether or not it is active as of the specified date.


validateTask

public static boolean validateTask(Long task,
                                   org.joda.time.LocalDate asOfDate)
No wildcarding is accounted for in this method.

Parameters:
task - Task "Long Name"
asOfDate - Can be null, if we just want to look for the general case.
Returns:
True if the task is present / valid.

validateEarnGroup

public static boolean validateEarnGroup(String earnGroup,
                                        org.joda.time.LocalDate asOfDate)
No wildcarding is accounted for in this method.

Parameters:
earnGroup - EarnCodeGroup
asOfDate - Can be null, if we just want to look for the general case.
Returns:
True if the EarnCodeGroup is present / valid.

earnGroupHasOvertimeEarnCodes

public static boolean earnGroupHasOvertimeEarnCodes(String earnGroup,
                                                    org.joda.time.LocalDate asOfDate)
Parameters:
earnGroup - EarnCodeGroup
asOfDate -
Returns:
True if the EarnCodeGroup has overtime earn codes

validateCalendar

public static boolean validateCalendar(String calendarName)
Checks for row presence of a pay calendar


duplicateDeptEarnCodeExists

public static boolean duplicateDeptEarnCodeExists(EarnCodeSecurity deptEarnCode)

validateOneYearFutureDate

public static boolean validateOneYearFutureDate(org.joda.time.LocalDate date)
Checks for date not more than one year in the future or current date


validateOneYearFutureEffectiveDate

public static boolean validateOneYearFutureEffectiveDate(org.joda.time.LocalDate date)
Checks for date not more than one year in the future and does not consider past date


validateFutureDate

public static boolean validateFutureDate(org.joda.time.LocalDate date)
Checks for date in the future


validateCalendarByType

public static boolean validateCalendarByType(String calendarName,
                                             String calendarType)
Checks for row presence of a pay calendar by calendar type


validateRecordMethod

public static boolean validateRecordMethod(String recordMethod,
                                           String accrualCategory,
                                           org.joda.time.LocalDate asOfDate)

validateEarnCodeFraction

public static boolean validateEarnCodeFraction(String earnCode,
                                               BigDecimal amount,
                                               org.joda.time.LocalDate asOfDate)

validatePayGradeWithSalaryGroup

public static boolean validatePayGradeWithSalaryGroup(String salaryGroup,
                                                      String payGrade,
                                                      org.joda.time.LocalDate asOfDate)

validateInstitution

public static boolean validateInstitution(String institutionCode,
                                          org.joda.time.LocalDate asOfDate)

validateCampus

public static boolean validateCampus(String campusCode)

isWildCard

public static boolean isWildCard(String aString)

wildCardMatch

public static boolean wildCardMatch(String string1,
                                    String string2)

validateAccount

public static boolean validateAccount(String chartOfAccountsCode,
                                      String accountNumber)
validates an open account exists matching the chart of accounts and account number.

Parameters:
chartOfAccountsCode -
accountNumber -
Returns:

validateSubAccount

public static boolean validateSubAccount(String subAccountNumber,
                                         String accountNumber,
                                         String chartOfAccountsCode)
validates existence of an active sub account matching the supplied params.

Parameters:
subAccountNumber -
accountNumber -
chartOfAccountsCode -
Returns:

validateObjectCode

public static boolean validateObjectCode(String financialObjectCode,
                                         String chartOfAccountsCode,
                                         Integer universityFiscalYear)
validates an active object code exists matching the supplied params.


validateSubObjectCode

public static boolean validateSubObjectCode(String universityFiscalYear,
                                            String chartOfAccountsCode,
                                            String accountNumber,
                                            String financialObjectCode,
                                            String financialSubObjectCode)
validates active sub object code existence matching the supplied params.

Parameters:
universityFiscalYear -
chartOfAccountsCode -
accountNumber -
financialObjectCode -
financialSubObjectCode -
Returns:

validateOrganization

public static boolean validateOrganization(String organizationCode,
                                           String chartOfAccountsCode)
validates an active organization matching organizationCode exists, whose chart of accounts code is chartOfAccountsCode

Parameters:
organizationCode -
chartOfAccountsCode -
Returns:

validateLocationWithSalaryGroup

public static boolean validateLocationWithSalaryGroup(String salaryGroup,
                                                      String location,
                                                      org.joda.time.LocalDate asOfDate)
validates location against location of salary group

Parameters:
salaryGroup -
location -
asOfDate -
Returns:


Copyright © 2004-2014 The Kuali Foundation. All Rights Reserved.