org.kuali.kfs.module.ar.document.validation.impl
Class CustomerInvoiceDueDateValidation

java.lang.Object
  extended by org.kuali.kfs.sys.document.validation.ParameterizedValidation
      extended by org.kuali.kfs.sys.document.validation.GenericValidation
          extended by org.kuali.kfs.module.ar.document.validation.impl.CustomerInvoiceDueDateValidation
All Implemented Interfaces:
Validation

public class CustomerInvoiceDueDateValidation
extends GenericValidation


Constructor Summary
CustomerInvoiceDueDateValidation()
           
 
Method Summary
 CustomerInvoiceDocument getCustomerInvoiceDocument()
           
 org.kuali.rice.kns.service.DateTimeService getDateTimeService()
           
static long getDifferenceInDays(Timestamp t1, Timestamp t2)
          This method calculates the difference in days between the two timestamps provided.
 org.kuali.rice.kns.service.ParameterService getParameterService()
           
 void setCustomerInvoiceDocument(CustomerInvoiceDocument customerInvoiceDocument)
           
 void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
           
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
           
 boolean validate(AttributedDocumentEvent event)
          This method validates that certain parameters
 
Methods inherited from class org.kuali.kfs.sys.document.validation.GenericValidation
setQuitOnFail, shouldQuitOnFail, stageValidation
 
Methods inherited from class org.kuali.kfs.sys.document.validation.ParameterizedValidation
getParameterProperties, populateParameterFromEvent, populateParametersFromEvent, setParameterProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomerInvoiceDueDateValidation

public CustomerInvoiceDueDateValidation()
Method Detail

validate

public boolean validate(AttributedDocumentEvent event)
Description copied from interface: Validation
This method validates that certain parameters

Returns:
true if validation should continue, false otherwise

getDifferenceInDays

public static long getDifferenceInDays(Timestamp t1,
                                       Timestamp t2)
This method calculates the difference in days between the two timestamps provided. This method is used instead of DateUtils.getDifferenceInDays() because there is a rounding issue within the timestamp that exists which must be dealt with to prevent improper calculations. This issue is similar to the problems that exist with adding and subtracting doubles and the inherently bad way that Java handles numbers. The approach used within DateUtils does not offer enough accuracy to calculate the difference consistently and accurately.

Parameters:
t1 -
t2 -
Returns:
The difference in days between the two given timestamps.

getCustomerInvoiceDocument

public CustomerInvoiceDocument getCustomerInvoiceDocument()

setCustomerInvoiceDocument

public void setCustomerInvoiceDocument(CustomerInvoiceDocument customerInvoiceDocument)

getDateTimeService

public org.kuali.rice.kns.service.DateTimeService getDateTimeService()

setDateTimeService

public void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)

getParameterService

public org.kuali.rice.kns.service.ParameterService getParameterService()

setParameterService

public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)


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