org.kuali.hr.time.util
Class ValidationUtils

java.lang.Object
  extended by org.kuali.hr.time.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 duplicateTimeOffAccrual(TimeOffAccrual timeOffAccrual)
           
static boolean earnGroupHasOvertimeEarnCodes(String earnGroup, Date asOfDate)
           
static boolean validateAccCategory(String accrualCategory, Date asOfDate)
           
static boolean validateAccrualCategory(String accrualCategory)
          Most basic validation: Only checks for presence in the database.
static boolean validateAccrualCategory(String accrualCategory, Date 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 validateChart(String chart)
           
static boolean validateDepartment(String department)
          Most basic validation: Only checks for presence in the database.
static boolean validateDepartment(String department, Date 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, Date asOfDate)
           
static boolean validateEarnCode(String earnCode, Date asOfDate)
           
static boolean validateEarnCodeOfAccrualCategory(String earnCode, String accrualCategory, String principalId, Date asOfDate)
           
static boolean validateEarnGroup(String earnGroup, Date asOfDate)
          No wildcarding is accounted for in this method.
static boolean validateFutureDate(Date date)
          Checks for date in the future
static boolean validateLocation(String location, Date asOfDate)
           
static boolean validateOneYearFutureDate(Date date)
          Checks for date not more than one year in the future or current date
static boolean validateOneYearFutureEffectiveDate(Date date)
          Checks for date not more than one year in the future and does not consider past date
static boolean validatePayGrade(String payGrade, Date asOfDate)
           
static boolean validatePayType(String payType, Date 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, Date asOfDate)
           
static boolean validateSalGroup(String salGroup, Date asOfDate)
           
static boolean validateTask(Long task, Date 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, Date 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, Date 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.
 
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,
                                       Date asOfDate)

validateEarnCode

public static boolean validateEarnCode(String earnCode,
                                       Date asOfDate)

validateEarnCodeOfAccrualCategory

public static boolean validateEarnCodeOfAccrualCategory(String earnCode,
                                                        String accrualCategory,
                                                        String principalId,
                                                        Date asOfDate)

validateAccCategory

public static boolean validateAccCategory(String accrualCategory,
                                          Date asOfDate)

validateLocation

public static boolean validateLocation(String location,
                                       Date asOfDate)

validatePayType

public static boolean validatePayType(String payType,
                                      Date asOfDate)

validatePayGrade

public static boolean validatePayGrade(String payGrade,
                                       Date asOfDate)

validateEarnCode

public static boolean validateEarnCode(String earnCode,
                                       boolean otEarnCode,
                                       Date 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,
                                         Date 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)

validateWorkArea

public static boolean validateWorkArea(Long workArea,
                                       Date 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,
                                       Date asOfDate)

validateAccrualCategory

public static boolean validateAccrualCategory(String accrualCategory,
                                              Date 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,
                                   Date 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,
                                        Date 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,
                                                    Date 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)

duplicateTimeOffAccrual

public static boolean duplicateTimeOffAccrual(TimeOffAccrual timeOffAccrual)

validateOneYearFutureDate

public static boolean validateOneYearFutureDate(Date date)
Checks for date not more than one year in the future or current date


validateOneYearFutureEffectiveDate

public static boolean validateOneYearFutureEffectiveDate(Date date)
Checks for date not more than one year in the future and does not consider past date


validateFutureDate

public static boolean validateFutureDate(Date 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,
                                           Date asOfDate)


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