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

java.lang.Object
  extended by org.kuali.kfs.sys.document.validation.ParameterizedValidation
      extended by org.kuali.kfs.sys.document.validation.BranchingValidation
          extended by org.kuali.kfs.module.purap.document.validation.impl.PurchasingAccountsPayableObjectCodeOverrideBranchingValidation
All Implemented Interfaces:
Validation

public class PurchasingAccountsPayableObjectCodeOverrideBranchingValidation
extends BranchingValidation

A validation which uses parameters to determine if a value on an accounting line is valid.


Field Summary
protected  AccountingDocument accountingDocumentForValidation
           
protected  AccountingLine accountingLineForValidation
           
protected static String OBJECT_CODE_NOT_OVERRIDEN
           
protected static String OBJECT_CODE_OVERRIDEN
           
protected  org.kuali.rice.kns.service.ParameterService parameterService
           
protected  String parameterToCheckAgainst
           
protected  String propertyPath
           
protected  String responsibleProperty
           
 
Fields inherited from class org.kuali.kfs.sys.document.validation.BranchingValidation
branchMap, parameterProperties, shouldQuitOnFail
 
Constructor Summary
PurchasingAccountsPayableObjectCodeOverrideBranchingValidation()
           
 
Method Summary
protected  Queue<String> convertPathToQueue(String path)
          Creates a Queue which represents a FIFO path of what properties to visit, based on the given property path
protected  String determineBranch(AttributedDocumentEvent event)
          Determines which branch, if any, within the branchMap should be used as the validation to take.
 AccountingDocument getAccountingDocumentForValidation()
          Gets the accountingDocumentForValidation attribute.
 AccountingLine getAccountingLineForValidation()
          Gets the accountingLineForValidation attribute.
 org.kuali.rice.kns.service.ParameterService getParameterService()
          Gets the parameterService attribute.
 String getParameterToCheckAgainst()
          Gets the parameterToCheckAgainst attribute.
 String getPropertyPath()
          Gets the propertyPath attribute.
 String getResponsibleProperty()
          Gets the responsibleProperty attribute.
protected  boolean isAccountingLineValueAllowed(Class documentClass, AccountingLine accountingLine, String parameterName, String propertyName, String userEnteredPropertyName)
          Checks that a value on an accounting line is valid, based on parameters, for a document of the given class
 void refreshByPath(AccountingLine line)
          Refreshes a value on the accounting line, using the propertyPath to decided what to refresh
protected  void refreshByQueue(org.kuali.rice.kns.bo.PersistableBusinessObject bo, Queue<String> path)
          Recursively refreshes a property given by the queue path
 void setAccountingDocumentForValidation(AccountingDocument accountingDocumentForValidation)
          Sets the accountingDocumentForValidation attribute value.
 void setAccountingLineForValidation(AccountingLine accountingLineForValidation)
          Sets the accountingLineForValidation attribute value.
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
          Sets the parameterService attribute value.
 void setParameterToCheckAgainst(String parameterToCheckAgainst)
          Sets the parameterToCheckAgainst attribute value.
 void setPropertyPath(String refreshPath)
          Sets the propertyPath attribute value.
 void setResponsibleProperty(String responsibleProperty)
          Sets the responsibleProperty attribute value.
 
Methods inherited from class org.kuali.kfs.sys.document.validation.BranchingValidation
getBranchMap, getParameterProperties, setBranchMap, setParameterProperties, setShouldQuitOnFail, shouldQuitOnFail, stageValidation, validate
 
Methods inherited from class org.kuali.kfs.sys.document.validation.ParameterizedValidation
populateParameterFromEvent, populateParametersFromEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propertyPath

protected String propertyPath

parameterToCheckAgainst

protected String parameterToCheckAgainst

parameterService

protected org.kuali.rice.kns.service.ParameterService parameterService

responsibleProperty

protected String responsibleProperty

accountingDocumentForValidation

protected AccountingDocument accountingDocumentForValidation

accountingLineForValidation

protected AccountingLine accountingLineForValidation

OBJECT_CODE_OVERRIDEN

protected static final String OBJECT_CODE_OVERRIDEN
See Also:
Constant Field Values

OBJECT_CODE_NOT_OVERRIDEN

protected static final String OBJECT_CODE_NOT_OVERRIDEN
See Also:
Constant Field Values
Constructor Detail

PurchasingAccountsPayableObjectCodeOverrideBranchingValidation

public PurchasingAccountsPayableObjectCodeOverrideBranchingValidation()
Method Detail

determineBranch

protected String determineBranch(AttributedDocumentEvent event)
Description copied from class: BranchingValidation
Determines which branch, if any, within the branchMap should be used as the validation to take.

Specified by:
determineBranch in class BranchingValidation
Parameters:
event - the event which triggered this validation
Returns:
the name of the branch to take, or a null or empty string to not take any branch and simply pass validation as true

isAccountingLineValueAllowed

protected boolean isAccountingLineValueAllowed(Class documentClass,
                                               AccountingLine accountingLine,
                                               String parameterName,
                                               String propertyName,
                                               String userEnteredPropertyName)
Checks that a value on an accounting line is valid, based on parameters, for a document of the given class

Parameters:
documentClass - the class of the document to check
accountingLine - the accounting line to check
parameterName - the name of the parameter to check
propertyName - the name of the property to check
userEnteredPropertyName - the value the user entered on the line
Returns:
true if this passes validation, false otherwise

refreshByPath

public void refreshByPath(AccountingLine line)
Refreshes a value on the accounting line, using the propertyPath to decided what to refresh

Parameters:
line - the accounting line to refresh a property on

convertPathToQueue

protected Queue<String> convertPathToQueue(String path)
Creates a Queue which represents a FIFO path of what properties to visit, based on the given property path

Parameters:
path - the path to convert to a Queue
Returns:
a Queue representing the path

refreshByQueue

protected void refreshByQueue(org.kuali.rice.kns.bo.PersistableBusinessObject bo,
                              Queue<String> path)
Recursively refreshes a property given by the queue path

Parameters:
bo - the business object to refresh
path - the path, in Queue form, of properties to refresh

getPropertyPath

public String getPropertyPath()
Gets the propertyPath attribute. This is the path to the value to check, e. g. "accountNumber.subFundGroup.fundGroupCode"

Returns:
Returns the propertyPath.

setPropertyPath

public void setPropertyPath(String refreshPath)
Sets the propertyPath attribute value. This is the path to the value to check, e. g. "accountNumber.subFundGroup.fundGroupCode"

Parameters:
propertyPath - The propertyPath to set.

getParameterService

public org.kuali.rice.kns.service.ParameterService getParameterService()
Gets the parameterService attribute.

Returns:
Returns the parameterService.

setParameterService

public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
Sets the parameterService attribute value.

Parameters:
parameterService - The parameterService to set.

getParameterToCheckAgainst

public String getParameterToCheckAgainst()
Gets the parameterToCheckAgainst attribute. This is the name of the parameter which has the values to validate against.

Returns:
Returns the parameterToCheckAgainst.

setParameterToCheckAgainst

public void setParameterToCheckAgainst(String parameterToCheckAgainst)
Sets the parameterToCheckAgainst attribute value. This is the name of the parameter which has the values to validate against.

Parameters:
parameterToCheckAgainst - The parameterToCheckAgainst to set.

getResponsibleProperty

public String getResponsibleProperty()
Gets the responsibleProperty attribute. This is the property on the accounting line to show the error on.

Returns:
Returns the responsibleProperty.

setResponsibleProperty

public void setResponsibleProperty(String responsibleProperty)
Sets the responsibleProperty attribute value. This is the property on the accounting line to show the error on.

Parameters:
responsibleProperty - The responsibleProperty to set.

getAccountingDocumentForValidation

public AccountingDocument getAccountingDocumentForValidation()
Gets the accountingDocumentForValidation attribute.

Returns:
Returns the accountingDocumentForValidation.

setAccountingDocumentForValidation

public void setAccountingDocumentForValidation(AccountingDocument accountingDocumentForValidation)
Sets the accountingDocumentForValidation attribute value.

Parameters:
accountingDocumentForValidation - The accountingDocumentForValidation to set.

getAccountingLineForValidation

public AccountingLine getAccountingLineForValidation()
Gets the accountingLineForValidation attribute.

Returns:
Returns the accountingLineForValidation.

setAccountingLineForValidation

public void setAccountingLineForValidation(AccountingLine accountingLineForValidation)
Sets the accountingLineForValidation attribute value.

Parameters:
accountingLineForValidation - The accountingLineForValidation to set.


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