org.kuali.kfs.module.purap.document.validation.impl
Class PurchasingCommodityCodeValidation

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.purap.document.validation.impl.PurchasingCommodityCodeValidation
All Implemented Interfaces:
Validation

public class PurchasingCommodityCodeValidation
extends GenericValidation


Constructor Summary
PurchasingCommodityCodeValidation()
           
 
Method Summary
protected  boolean commodityCodeIsRequired()
          Predicate to do a parameter lookup and tell us whether a commodity code is required.
 org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()
           
 org.kuali.rice.kns.service.DataDictionaryService getDataDictionaryService()
           
 PurApItem getItemForValidation()
           
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
           
 void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)
           
 void setItemForValidation(PurApItem itemForValidation)
           
 boolean validate(AttributedDocumentEvent event)
          This method validates that certain parameters
protected  boolean validateCommodityCodes(PurApItem item, boolean commodityCodeRequired)
          Validates whether the commodity code existed on the item, and if existed, whether the commodity code on the item existed in the database, and if so, whether the commodity code is active.
protected  boolean validateThatCommodityCodeIsActive(PurApItem item)
           
 
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

PurchasingCommodityCodeValidation

public PurchasingCommodityCodeValidation()
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

getItemForValidation

public PurApItem getItemForValidation()

setItemForValidation

public void setItemForValidation(PurApItem itemForValidation)

validateCommodityCodes

protected boolean validateCommodityCodes(PurApItem item,
                                         boolean commodityCodeRequired)
Validates whether the commodity code existed on the item, and if existed, whether the commodity code on the item existed in the database, and if so, whether the commodity code is active. Display error if any of these 3 conditions are not met.

Parameters:
item - The PurApItem containing the commodity code to be validated.
Returns:
boolean false if the validation fails and true otherwise.

validateThatCommodityCodeIsActive

protected boolean validateThatCommodityCodeIsActive(PurApItem item)

commodityCodeIsRequired

protected boolean commodityCodeIsRequired()
Predicate to do a parameter lookup and tell us whether a commodity code is required. Override in child classes.

Returns:
True if a commodity code is required.

getBusinessObjectService

public org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()

setBusinessObjectService

public void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)

getDataDictionaryService

public org.kuali.rice.kns.service.DataDictionaryService getDataDictionaryService()

setDataDictionaryService

public void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)


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